From 7a7da7bae78e9200e5fc6dd7797988fffb689a04 Mon Sep 17 00:00:00 2001 From: iou1name Date: Mon, 11 Jun 2018 12:49:36 -0400 Subject: [PATCH] reordered calc.py's aliases, changed remind.py to wait on stop condition, added timeout to url.py --- modules/calc.py | 2 +- modules/remind.py | 2 +- modules/url.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/calc.py b/modules/calc.py index e1f23a4..6e9e86f 100755 --- a/modules/calc.py +++ b/modules/calc.py @@ -11,7 +11,7 @@ from tools.calculation import eval_equation BASE_TUMBOLIA_URI = 'https://tumbolia-two.appspot.com/' -@commands('c', 'calc') +@commands('calc', 'c') @example('.c 5 + 3', '8') def c(bot, trigger): """Evaluate some calculation.""" diff --git a/modules/remind.py b/modules/remind.py index 2cb3aeb..78c489f 100755 --- a/modules/remind.py +++ b/modules/remind.py @@ -44,7 +44,7 @@ class MonitorThread(threading.Thread): delete_reminder(self._bot, oldtime) if not self._bot.memory["remind"] or not self._bot.stillConnected(): self.stop.set() - time.sleep(2.5) + self.stop.wait(2.5) del self._bot.memory["remind_monitor"] diff --git a/modules/url.py b/modules/url.py index 7e97abd..a26f95e 100755 --- a/modules/url.py +++ b/modules/url.py @@ -35,7 +35,7 @@ def title_auto(bot, trigger): if broken: continue try: - res = requests.get(url, headers=HEADERS, verify=True) + res = requests.get(url, headers=HEADERS, verify=True, timeout=10) except requests.exceptions.ConnectionError: continue try: