[Python-modules-commits] [keyrings.alt] 02/02: Include file_path in repr of FileBacked backends.
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Wed Mar 2 07:21:16 UTC 2016
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to tag 1.1
in repository keyrings.alt.
commit 6a0208f5d335fe9f662cf31322068aa1c45ba24e
Author: Jason R. Coombs <jaraco at jaraco.com>
Date: Thu Jan 14 13:30:04 2016 -0500
Include file_path in repr of FileBacked backends.
---
CHANGES.rst | 6 ++++++
keyrings/alt/file.py | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/CHANGES.rst b/CHANGES.rst
index 9e6c723..b8a1c5a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,9 @@
+1.1
+===
+
+FileBacked backends now have a ``repr`` that includes the file path.
+
+
1.0
===
diff --git a/keyrings/alt/file.py b/keyrings/alt/file.py
index 89563c8..ad3e19f 100644
--- a/keyrings/alt/file.py
+++ b/keyrings/alt/file.py
@@ -30,6 +30,10 @@ class FileBacked(object):
"""
return os.path.join(platform_.data_root(), self.filename)
+ def __repr__(self):
+ tmpl = "<{self.__class__.__name__} at {self.file_path}>"
+ return tmpl.format(**locals())
+
class BaseKeyring(FileBacked, KeyringBackend):
"""
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/keyrings.alt.git
More information about the Python-modules-commits
mailing list