#NEWLINE# def main( ) : #NEWLINE# #INDENT# program = oi . Program ( 'my program' , 'ipc:///tmp/oi-qixdlkfuep.sock' ) #NEWLINE# hn_worker = HNWorker ( program ) #NEWLINE# watch_worker = WatchWorker ( program ) #NEWLINE# notify_worker = NotifyWorker ( program ) #NEWLINE# notify_worker . do ( ( lambda story : notify_osx ( story ) ) ) #NEWLINE# program . workers . append ( hn_worker ) #NEWLINE# program . workers . append ( watch_worker ) #NEWLINE# program . workers . append ( notify_worker ) #NEWLINE# c = Commands ( program ) #NEWLINE# program . add_command ( 'top' , ( lambda : c . which ( 'top' ) ) , 'show top stories' ) #NEWLINE# program . add_command ( 'new' , ( lambda : c . which ( 'new' ) ) , 'show new stories' ) #NEWLINE# program . add_command ( 'ask' , ( lambda : c . which ( 'ask' ) ) , 'show ask stories' ) #NEWLINE# program . add_command ( 'jobs' , ( lambda : c . which ( 'jobs' ) ) , 'show jobs stories' ) #NEWLINE# program . add_command ( 'show' , ( lambda : c . which ( 'show' ) ) , 'show(show) stories' ) #NEWLINE# program . add_command ( 'ping' , c . ping , 'ping HN' ) #NEWLINE# program . add_command ( 'user' , c . user , 'show user profile' ) #NEWLINE# program . add_command ( 'open' , c . open , 'show in browser' ) #NEWLINE# program . run ( )