auto-schedule-pro-v2 #8

Manually merged
Contributor

Formatted according to PEP8 and added f-strings, no initial issues found.

Formatted according to PEP8 and added f-strings, no initial issues found.
Rhinemann added 2 commits 2023-05-08 10:02:42 +03:00
Author
Contributor

Oh, also fixing some typos too.

Oh, also fixing some typos too.
Rhinemann added 1 commit 2023-05-08 10:13:03 +03:00
Rhinemann added 1 commit 2023-05-08 10:20:54 +03:00
Rhinemann added 1 commit 2023-05-08 10:21:37 +03:00
Rhinemann added 1 commit 2023-05-08 10:26:57 +03:00
dymik739 requested changes 2023-05-08 12:13:59 +03:00
dymik739 left a comment
Owner

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 "понеділок"...)

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()
Owner

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)

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)
Author
Contributor

Okay, sure thing.

Okay, sure thing.
@ -154,3 +160,3 @@
# message queue object to go back to synchronous message processing
#class MessageQueue:
# class MessageQueue:
Owner

That commented block is not really used for anything, so we can probably just delete it)

That commented block is not really used for anything, so we can probably just delete it)
Author
Contributor

Agreed.

Agreed.
@ -225,3 +231,3 @@
mcu = ModuleControlUnit()
processor_thread = threading.Thread( target = queue_processor, args = [] )
processor_thread = threading.Thread(target=queue_processor, args=[])
Owner

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)

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 = ["понеділок", "вівторок", "середу", "четвер", "п'ятницю", "суботу", "неділю"]
Owner

понеділок)

понеділок)
@ -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")):
Owner

Sometimes I question what do people developing PEP8 consider "readable"...
This change is fine, even though it scares me

Sometimes I question what do people developing PEP8 consider "readable"... This change is fine, even though it scares me
Author
Contributor

That one is weird, we can tweak it a bit.
Like this, for example:

if ((current_day + 2) == int(start_datetime.strftime("%u"))) or \
            ((current_day == 6) and (start_datetime.strftime("%u") == "1")):

Seems a tad better to me.

That one is weird, we can tweak it a bit. Like this, for example: ```python if ((current_day + 2) == int(start_datetime.strftime("%u"))) or \ ((current_day == 6) and (start_datetime.strftime("%u") == "1")): ``` Seems a tad better to me.
Owner

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)

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)
Rhinemann added 1 commit 2023-05-08 12:26:12 +03:00
Rhinemann added 1 commit 2023-05-08 12:43:33 +03:00
Rhinemann reviewed 2023-05-08 12:50:18 +03:00
@ -71,2 +75,2 @@
responce = self.obj.process(msg, self.path)
return responce
response = self.obj.process(msg, self.path)
return response
Author
Contributor

By the way, maybe we can try

            return self.obj.process(msg, self.path)

As an option? Since the variable isn't really used.

By the way, maybe we can try ```python return self.obj.process(msg, self.path) ``` As an option? Since the variable isn't really used.
Owner

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)

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)
Owner

Also, there is one occurance of responce_text not changed in file modules/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)

Also, there is one occurance of `responce_text` not changed in file `modules/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)
dymik739 requested changes 2023-05-08 20:33:16 +03:00
dymik739 left a comment
Owner

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

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`
dymik739 manually merged commit 44628a3021 into auto-schedule-pro-v2 2023-06-27 16:11:40 +03:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: dymik739/modular-bot-framework-for-telegram#8
No description provided.