From df7facd7bdf9f9b1c7a8bc309762930fb6bb7c68 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 17 Jan 2021 19:05:53 +0000 Subject: [PATCH] small fixes --- .theia/settings.json | 4 +++- bot1/chats.py | 2 +- bot1/users.py | 1 + dev.theia-workspace | 8 ++++++++ misc/utils.py | 1 + 5 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 dev.theia-workspace diff --git a/.theia/settings.json b/.theia/settings.json index 0f0e0d1..b8aff58 100644 --- a/.theia/settings.json +++ b/.theia/settings.json @@ -1,3 +1,5 @@ { + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, "python.pythonPath": "/usr/local/bin/python3" -} \ No newline at end of file +} \ No newline at end of file diff --git a/bot1/chats.py b/bot1/chats.py index 757efbe..4219958 100644 --- a/bot1/chats.py +++ b/bot1/chats.py @@ -1,6 +1,6 @@ import yaml -from pytgbot.bot.sync import SyncBot +from pytgbot.bot.synchronous import SyncBot from pytgbot.api_types.sendable.inline import ( InlineQueryResultArticle, InputTextMessageContent, diff --git a/bot1/users.py b/bot1/users.py index 15e6757..009f627 100644 --- a/bot1/users.py +++ b/bot1/users.py @@ -44,6 +44,7 @@ class UserManager(SaveFileMapping): self.from_file() def from_dict(self,d): + if not d: return for k in d: self[k]=User(**d[k]) diff --git a/dev.theia-workspace b/dev.theia-workspace new file mode 100644 index 0000000..99e7c38 --- /dev/null +++ b/dev.theia-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "" + } + ], + "settings": {} +} \ No newline at end of file diff --git a/misc/utils.py b/misc/utils.py index 8a8d0fe..3875956 100644 --- a/misc/utils.py +++ b/misc/utils.py @@ -41,6 +41,7 @@ class SaveFileMapping(Mapping): except FileNotFoundError as e: with open(fn,'w') as f: f.write("") + d={} self.from_dict(d) def __getitem__(self,key):