auto-schedule-pro-v2 #8
Loading…
Reference in New Issue
No description provided.
Delete Branch "Rhinemann/modular-bot-framework-for-telegram:auto-schedule-pro-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Formatted according to PEP8 and added f-strings, no initial issues found.
Oh, also fixing some typos too.
Overall, it's a great pull request;
There is one thing that is missing though: all the changes to module-testing.py are not mirrored to main.py for the deployment (we probably need a script or something that will automatically copy all the changes from module-testing.py to main.py and vice-versa)
Also, there are some details I've described in the code comments, but they're all minor) (and "понеділок"...)
@ -16,3 +17,3 @@
def readfile(filename):
try:
return codecs.open(filename, encoding = "utf-8").read()
return codecs.open(filename, encoding="utf-8").read()
The standart states that there should be no spaces between key=value arguments;
I don't know why, but I've always written those with spaces just so that the code feels more spacious and free (basically, it's just a personal preference, which is wrong in terms of PEP8 standart; I'll probably get rid of it at some point (just like with using f-strings instead of
str.format()
method), but it might take some time)Okay, sure thing.
@ -154,3 +160,3 @@
# message queue object to go back to synchronous message processing
#class MessageQueue:
# class MessageQueue:
That commented block is not really used for anything, so we can probably just delete it)
Agreed.
@ -225,3 +231,3 @@
mcu = ModuleControlUnit()
processor_thread = threading.Thread( target = queue_processor, args = [] )
processor_thread = threading.Thread(target=queue_processor, args=[])
The same as above, but I'm fine with removing spaces around all arguments like so:
Thread( target = queue_processor, args = [] ) -> Thread(target = queue_processor, args = [])
(hopefully I'll learn to put spaces correctly at some point)
@ -9,3 +11,2 @@
# Accusative - znahidnyj
WEEKDAYS_ACCUSATIVE = ["понедулок", "вівторок", "середу", "четвер",
"п'ятницю", "суботу", "неділю"]
WEEKDAYS_ACCUSATIVE = ["понеділок", "вівторок", "середу", "четвер", "п'ятницю", "суботу", "неділю"]
понеділок)
@ -29,2 +26,3 @@
human_readable_date = ""
if ((current_day + 2) == int(start_datetime.strftime("%u"))) or ((current_day == 6) and (start_datetime.strftime("%u") == "1")):
if ((current_day + 2) == int(start_datetime.strftime("%u"))) or (
(current_day == 6) and (start_datetime.strftime("%u") == "1")):
Sometimes I question what do people developing PEP8 consider "readable"...
This change is fine, even though it scares me
That one is weird, we can tweak it a bit.
Like this, for example:
Seems a tad better to me.
Yeah, this looks way better) (it's a very minor detail, but, for some reason, stray parenthese on a line bothers me whenever I look at it whereas a simple backslash looks absolutely fine)
@ -71,2 +75,2 @@
responce = self.obj.process(msg, self.path)
return responce
response = self.obj.process(msg, self.path)
return response
By the way, maybe we can try
As an option? Since the variable isn't really used.
That's a very good call) (I'm not sure why have I created that variable in the first place, but yes, it seems to not have a purpose)
We may address this after the PR merge, because it's relevant to the master branch and not to the auto-schedule-pro-v2 (this branch will probably be merged into master and deleted once this PR is complete and merged)
Also, there is one occurance of
responce_text
not changed in filemodules/qna-basic/db/obj.json
which breaks the module (sure, it hasn't been touched for about 9 months now, but it might become useful at some point, so it's worth keeping)Everything is alright besides
modules/qna-basic/
being broken by the API change (it failed to load response from the database during the local testing)For some reason, I can't fork your fork to make a PR regarding this PR (I wanted to push a commit addressing this into this PR; maybe, there is another way to push a commit into a PR?), but the fix is really simple; in the file
modules/qna-basic/db/obj.json
the dictionary key should be changed at line 5 like this:responce_text -> response_text