From 0c313565f2b649366f7382dc1b3f28a3e80f4ffc Mon Sep 17 00:00:00 2001 From: nico Date: Tue, 6 Nov 2018 23:43:11 +0100 Subject: simplification and major rework * updated gitignore file * partly reworked servercontact implementation * complete rework of uptime, version * part rework of xep requests + added more comments to xep requests + added opt_arg to version, xep and contact * complete rework of validate function * updated HandleError function * part rework of StaticStrings function + implemented data dictionary to hold all data in main bot + added message_ids * complete rework of queue building and deduplication --- common/strings.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'common/strings.py') diff --git a/common/strings.py b/common/strings.py index 6866a31..faac65c 100644 --- a/common/strings.py +++ b/common/strings.py @@ -29,14 +29,13 @@ class StaticAnswers: "number_keywords": ["!xep"] } - def keys(self, arg="", keyword='keywords'): - if arg == 'list': - try: - return self.keywords[keyword] - except KeyError: - return self.keywords['keywords'] + def keys(self, key=""): + # if specific keyword in referenced return that + if key in self.keywords.keys(): + return self.keywords[key] + # in any other case return the whole dict else: - return self.keywords + return self.keywords["keywords"] def gen_help(self): helpdoc = "\n".join(['%s' % value for (_, value) in self.helpfile.items()]) -- cgit v1.2.3-54-g00ecf