now possible to give the orangutang bananas

This commit is contained in:
Péter Henrik Gombos 2011-10-09 16:06:32 +00:00
parent 9746e7d1f2
commit 5abde71f2e

View File

@ -367,6 +367,9 @@ def map_cmd(connection, shelfname=None, category=None):
def suggest_book_data(connection, tmp_file=False):
google_suggest_book_data(connection, tmp_file)
def give_bananas():
print "Om nom nom... Thanks!"
commands = { 'show':
{ 'args': [('ids', (1,None))],
'options': ['commit_format', 'tmp_file'],
@ -406,7 +409,12 @@ commands = { 'show':
{ 'args': [],
'options': ['tmp_file'],
'fun': suggest_book_data,
'use_db': True }
'use_db': True },
'give-bananas':
{ 'args': [],
'options': [],
'fun': give_bananas,
'use_db': False },
}
flags = { 'commit_format':
@ -436,6 +444,7 @@ def check_command_args(args, command):
raise BadCommandLine('Too many arguments for command %s (expects at most %d, %d given).'
% (command, max_num_args, len(args)))
def check_command_opts(opts, command):
cmd_decl = commands[command]
for opt,val in opts: