From 027933b645571155f1d176b0dcb2d438487545fc Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Wed, 29 Jan 2020 14:35:19 -0800 Subject: [PATCH] str/repr changes --- amanuensis/lexicon/__init__.py | 6 ++++++ amanuensis/user.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/amanuensis/lexicon/__init__.py b/amanuensis/lexicon/__init__.py index c7953dc..4ca3f7b 100644 --- a/amanuensis/lexicon/__init__.py +++ b/amanuensis/lexicon/__init__.py @@ -46,6 +46,12 @@ class LexiconModel(): raise AttributeError(key) return self.config.get(key) + def __str__(self): + return ''.format(self) + + def __repr__(self): + return ''.format(self) + def log(self, message): now = int(time.time()) with json_rw(self.config_path) as j: diff --git a/amanuensis/user.py b/amanuensis/user.py index eb0de05..dd16cc7 100644 --- a/amanuensis/user.py +++ b/amanuensis/user.py @@ -50,7 +50,7 @@ class UserModel(UserMixin): return self.config.get(key) def __str__(self): - return ''.format(self.username) + return '<{0.username}>'.format(self) def __repr__(self): return ''.format(self)