From b28005984c8109c0af8aeb5c1a173730c7d7bb97 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Tue, 18 Dec 2012 16:46:20 -0600 Subject: makeadmin and changepasswd had swapped help text --- mediagoblin/gmg_commands/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mediagoblin/gmg_commands') diff --git a/mediagoblin/gmg_commands/__init__.py b/mediagoblin/gmg_commands/__init__.py index e965dd57..19793ec3 100644 --- a/mediagoblin/gmg_commands/__init__.py +++ b/mediagoblin/gmg_commands/__init__.py @@ -37,11 +37,11 @@ SUBCOMMAND_MAP = { 'makeadmin': { 'setup': 'mediagoblin.gmg_commands.users:makeadmin_parser_setup', 'func': 'mediagoblin.gmg_commands.users:makeadmin', - 'help': 'Changes a user\'s password'}, + 'help': 'Makes user an admin'}, 'changepw': { 'setup': 'mediagoblin.gmg_commands.users:changepw_parser_setup', 'func': 'mediagoblin.gmg_commands.users:changepw', - 'help': 'Makes admin an user'}, + 'help': 'Changes a user\'s password'}, 'dbupdate': { 'setup': 'mediagoblin.gmg_commands.dbupdate:dbupdate_parse_setup', 'func': 'mediagoblin.gmg_commands.dbupdate:dbupdate', -- cgit v1.2.3 From 4d9b426ccfe4b6a3c875e75399011d7cf25aa379 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Tue, 18 Dec 2012 16:54:07 +0100 Subject: Try ipython-based shell first, falling back to plain shell Signed-off-by: Sebastian Spaeth --- mediagoblin/gmg_commands/shell.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'mediagoblin/gmg_commands') diff --git a/mediagoblin/gmg_commands/shell.py b/mediagoblin/gmg_commands/shell.py index ec1ab535..4998acd7 100644 --- a/mediagoblin/gmg_commands/shell.py +++ b/mediagoblin/gmg_commands/shell.py @@ -47,24 +47,21 @@ def py_shell(**user_namespace): def ipython_shell(**user_namespace): """ - Run a shell for the user using ipython. + Run a shell for the user using ipython. Return False if there is no IPython """ try: from IPython import embed except: - print "IPython not available... exiting!" - return - + return False + embed( banner1=SHELL_BANNER, user_ns=user_namespace) - + return True def shell(args): """ - Setup a shell for the user - either a normal Python shell - or an IPython one + Setup a shell for the user either a normal Python shell or an IPython one """ user_namespace = { 'mg_globals': mg_globals, @@ -74,4 +71,6 @@ def shell(args): if args.ipython: ipython_shell(**user_namespace) else: - py_shell(**user_namespace) + # Try ipython_shell first and fall back if not available + if not ipython_shell(**user_namespace): + py_shell(**user_namespace) -- cgit v1.2.3