Skip to content

Commit

Permalink
[calc] Remove unneeded admin-only restriction on .py
Browse files Browse the repository at this point in the history
  • Loading branch information
embolalia committed Jan 3, 2013
1 parent 006bdfe commit 6f7a21b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@ def c(willie, trigger):
c.example = '.c 5 + 3'

def py(willie, trigger):
"""Evaluate a Python expression. Admin-only."""
if trigger.admin:
query = trigger.group(2).encode('utf-8')
uri = 'http://tumbolia.appspot.com/py/'
answer = web.get(uri + web.quote(query))
if answer:
willie.say(answer)
else: willie.reply('Sorry, no result.')
"""Evaluate a Python expression."""
query = trigger.group(2).encode('utf-8')
uri = 'http://tumbolia.appspot.com/py/'
answer = web.get(uri + web.quote(query))
if answer:
willie.say(answer)
else: willie.reply('Sorry, no result.')
py.commands = ['py']
py.example = '.py len([1,2,3])'

Expand Down

0 comments on commit 6f7a21b

Please sign in to comment.