Skip to content

Commit

Permalink
Refactored into working state.
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoryvp committed Aug 23, 2012
1 parent e156d35 commit 4b5d296
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
7 changes: 7 additions & 0 deletions parabridge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python
# coding:utf-8 vi:et:ts=2

import parabridge

parabridge.app()

43 changes: 22 additions & 21 deletions parabridge/parabridge.py → parabridge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,26 @@ def task_list( i_oArgs ) :
mTask[ 'src' ],
mTask[ 'dst' ] ) )

Settings.init( notify = True )
oParser = argparse.ArgumentParser( description = HELP_APP )
oSubparsers = oParser.add_subparsers()
oSubparser = oSubparsers.add_parser( 'start', help = HELP_START )
oSubparser.set_defaults( handler = start )
oSubparser = oSubparsers.add_parser( 'stop', help = HELP_STOP )
oSubparser.set_defaults( handler = stop )
oSubparser = oSubparsers.add_parser( 'status', help = HELP_STATUS )
oSubparser.set_defaults( handler = status )
oSubparser = oSubparsers.add_parser( 'task_add', help = HELP_TASK_ADD )
oSubparser.set_defaults( handler = task_add )
oSubparser.add_argument( 'task_name' )
oSubparser.add_argument( 'task_src' )
oSubparser.add_argument( 'task_dst' )
oSubparser = oSubparsers.add_parser( 'task_del', help = HELP_TASK_DEL )
oSubparser.set_defaults( handler = task_del )
oSubparser.add_argument( 'task_name' )
oSubparser = oSubparsers.add_parser( 'task_list', help = HELP_TASK_LIST )
oSubparser.set_defaults( handler = task_list )
oArgs = oParser.parse_args()
oArgs.handler( oArgs )
def app() :
Settings.init( notify = True )
oParser = argparse.ArgumentParser( description = HELP_APP )
oSubparsers = oParser.add_subparsers()
oSubparser = oSubparsers.add_parser( 'start', help = HELP_START )
oSubparser.set_defaults( handler = start )
oSubparser = oSubparsers.add_parser( 'stop', help = HELP_STOP )
oSubparser.set_defaults( handler = stop )
oSubparser = oSubparsers.add_parser( 'status', help = HELP_STATUS )
oSubparser.set_defaults( handler = status )
oSubparser = oSubparsers.add_parser( 'task_add', help = HELP_TASK_ADD )
oSubparser.set_defaults( handler = task_add )
oSubparser.add_argument( 'task_name' )
oSubparser.add_argument( 'task_src' )
oSubparser.add_argument( 'task_dst' )
oSubparser = oSubparsers.add_parser( 'task_del', help = HELP_TASK_DEL )
oSubparser.set_defaults( handler = task_del )
oSubparser.add_argument( 'task_name' )
oSubparser = oSubparsers.add_parser( 'task_list', help = HELP_TASK_LIST )
oSubparser.set_defaults( handler = task_list )
oArgs = oParser.parse_args()
oArgs.handler( oArgs )

0 comments on commit 4b5d296

Please sign in to comment.