Skip to content

Simplify xmpp wikibot a bit#620

Merged
jerjou merged 1 commit into
masterfrom
wikibot
Oct 27, 2016
Merged

Simplify xmpp wikibot a bit#620
jerjou merged 1 commit into
masterfrom
wikibot

Conversation

@jerjou

@jerjou jerjou commented Oct 27, 2016

Copy link
Copy Markdown
Contributor

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 27, 2016

@theacodes theacodes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after nits

Comment thread compute/xmpp_wikibot/wikibot.py Outdated
msg_body = msg['body']
logging.info('Message sent was: {}'.format(msg_body))
encoded_body = urllib.quote_plus(msg_body)
svrResponse = requests.get(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go ahead and make this snake_case while you're here?

Comment thread compute/xmpp_wikibot/wikibot.py Outdated
msg_body)).send()
return

snippet = unicode(results[0]['snippet'])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unicode doesn't exist in python 3, try six.text_type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm... I don't even remember why I was casting it to unicode anyway (especially since the encoding in wikipedia is fickle, I think). I'm just going to remove the unicode cast.

Comment thread compute/xmpp_wikibot/wikibot.py Outdated
# Connect to the XMPP server and start processing XMPP stanzas.
if xmpp.connect():
xmpp.process(block=True)
app.run(threaded=True, use_reloader=False, host='0.0.0.0')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug=False?

@jerjou jerjou merged commit 7193d1e into master Oct 27, 2016
@jerjou jerjou deleted the wikibot branch October 27, 2016 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants