diff options
author | 2012-07-11 20:43:48 +0200 | |
---|---|---|
committer | 2012-07-11 20:43:48 +0200 | |
commit | c093c088bd20bbc59bd9ee947788422745a12dca (patch) | |
tree | 8a10409d337a914698918c0bcb789f6ac8889fca /roverlay.py | |
parent | depres console (module code) (diff) | |
download | R_overlay-c093c088bd20bbc59bd9ee947788422745a12dca.tar.gz R_overlay-c093c088bd20bbc59bd9ee947788422745a12dca.tar.bz2 R_overlay-c093c088bd20bbc59bd9ee947788422745a12dca.zip |
depres console (main script)
* added depres console to roverlay.py
modified: roverlay.py
Diffstat (limited to 'roverlay.py')
-rwxr-xr-x | roverlay.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/roverlay.py b/roverlay.py index ce1189f..ae67d6a 100755 --- a/roverlay.py +++ b/roverlay.py @@ -11,6 +11,7 @@ class DIE ( object ): NOP = os.EX_OK ERR = 1 BAD_USAGE = os.EX_USAGE + USAGE = os.EX_USAGE ARG = 9 CONFIG = os.EX_CONFIG OV_CREATE = 20 @@ -54,7 +55,8 @@ COMMAND_DESCRIPTION = { 'sync' : 'sync repos', 'create' : 'create the overlay ' '(implies sync, override with --nosync)', -# 'depres_console' : 'run an interactive depres console; TODO/REMOVE', + 'depres_console' : 'run an interactive depres console (highly experimental)', + 'depres' : 'this is an alias to \'depres_console\'', 'nop' : 'does nothing', } @@ -131,6 +133,27 @@ if not actions: # this happens if a command is nop die ( "Nothing to do!", DIE.NOP ) +if 'depres_console' in actions or 'depres' in actions: + if len ( actions ) != 1: + die ( "depres_console cannot be run with other commands!", DIE.USAGE ) + + try: + from roverlay.depres.simpledeprule.console import DepResConsole + con = DepResConsole() + con.run() + sys.exit ( os.EX_OK ) + except ImportError: + if HIDE_EXCEPTIONS: + die ( "Cannot import depres console!", DIE.IMPORT ) + else: + raise + except: + if HIDE_EXCEPTIONS: + die ( "Exiting on console error!", DIE.ERR ) + else: + raise + + # -- import roverlay modules |