-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the URL generated when no arguments is passed to .logs #475
Conversation
Fixes #474 Remove the excess .log added to the end of the URL when .logs is used with no arguments.
I am sure that this tweak will fix the bug but I wasn't able to test it locally. |
Hmm, it's been a while since I've run this bot so I'm not sure. Are you getting an error when running it? Also, I suggest just adding a test that verifies this behavior! That should be sufficient. |
I am not sure what should happen when I run the bot locally. My question is how to update values like host, channels in the default.py file?
|
Ah, use a test channel like |
modules/test/test_apertium_wiki.py
Outdated
self.input.group = lambda x: [None, None][x] | ||
apertium_wiki.logs(self.phenny, self.input) | ||
out = self.phenny.say.call_args[0][0] | ||
string_check = ("Log at " in out) and (not out.endswith(".log")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use single quotes to match the rest of the file. Also, just go ahead and inline this since there's only one check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the file has mixed single and double quotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh. Okay, then this is fine. If you'd like, switch them all to be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would like to do so.
Does Apertium has some sort of coding conventions?
I also prefer single quotes for strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this repo, no. In apertium-streamparser, apertium-init and apertium-apy, we stick to single quotes. So, that works for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer opening a new issue for the mixed single and double quotes.
I also think we should check the rest of the repo's files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are too many stylistic issues/inconsistencies for a single issue and given that this repo is a fork, I'd like to stay away from sweeping changes, It's fine for this file since this module doesn't exist in upstream.
Do you mind providing a transcript of a chat log while you were testing? Then this should be mergeable. Thanks! |
Can I just copy the messages from the testing channel and paste them as a comment here? |
Yeah, that's what I mean by transcript. |
|
Good work! |
Thanks @sushain97. |
@jonorthwash usually takes care of restarting it. |
I pulled and restarted, but it looks like I only got the following updates:
|
Oh, interesting, those look like what the PR contained. I'd guessed the logs had their own module. |
@jonorthwash Yes, actually the solution required a simple tweak. |
Fixes #474
Remove the excess .log added to the end of the URL when .logs is
used with no arguments.