rawsonj / triviabot

A simple IRC trivia bot written in python using twisted.
GNU General Public License v3.0
41 stars 50 forks source link

minor changes, edits, deletions. See diff #49

Closed andy5995 closed 8 years ago

andy5995 commented 8 years ago

Thought I'd dip my toe in the water, so to speak. Let me know if any changes need to made to this pull request.

rawsonj commented 8 years ago

Hi Andy,

I just have 2 bits of feedback.

1: Thanks for the SSL parts. My preference would be to implement the switch explicitly as "yes" or "no" rather than anything or "NO," but I don't see that as a blocker for merging. Only reason why is "explicit is better than implicit," and I think it's reasonable to throw an exception if a config setting isn't properly set.

2: You added a print(savefile) to an exception handler, and I was just curious why? Also, the more I look at that code the more it should be rewritten entirely... sigh

I wrote this when I was learning python and twisted, and cleaning up the bot and rewriting it has been perpetually on my todo list.

andy5995 commented 8 years ago

Hi @rawsonj I should have deleted print(savefile). I put that there earlier tonight because I couldn't figure out why the connection was failing (that error showed with save file not found). So I decided to print out the variable so I could see it.

Turns out the connection was failing because I couldn't connect with SSL. And as you know, the save file (scores.json) is created upon the first successful startup. So no problem with that.

I never coded python before today. I've been slowly learning C over 20 years though. ;) Best of luck to you.

rawsonj commented 8 years ago

No worries. I'll remove that, and make the switch more explicit.

And thanks! :)

andy5995 commented 8 years ago

Ok, thanks for taking care of that. In the future, feel free to ask me to make changes before a final commit. :)