Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

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
1 changed files with 10 additions and 1 deletions

View File

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