From 5abde71f2ed33ed46a44e76e4f3001594a5a7a8a Mon Sep 17 00:00:00 2001 From: gombos Date: Sun, 9 Oct 2011 16:06:32 +0000 Subject: [PATCH] now possible to give the orangutang bananas --- cli/worblehat.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cli/worblehat.py b/cli/worblehat.py index 3283441..5f44318 100755 --- a/cli/worblehat.py +++ b/cli/worblehat.py @@ -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: