diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-10-23 12:47:25 +0200 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-10-23 12:47:25 +0200 |
commit | 9043e7a012c0b01a993e04831180005ff36730d6 (patch) | |
tree | c71f64bdfa9b55ffde8e17f97726bbb2d437956c /mediagoblin/gmg_commands/users.py | |
parent | eb5bb3fc997da26a39d6d77888574b634f00db57 (diff) | |
download | mediagoblin-9043e7a012c0b01a993e04831180005ff36730d6.tar.lz mediagoblin-9043e7a012c0b01a993e04831180005ff36730d6.tar.xz mediagoblin-9043e7a012c0b01a993e04831180005ff36730d6.zip |
Refactor gmg's cf option into a function
Many (all?) gmg subcommands take a -cf option to change the
used config file. This options used to be created in each
subcommand's parse_setup. Add a helper function and use it
around.
Diffstat (limited to 'mediagoblin/gmg_commands/users.py')
-rw-r--r-- | mediagoblin/gmg_commands/users.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/mediagoblin/gmg_commands/users.py b/mediagoblin/gmg_commands/users.py index 5421907d..f6b03bf1 100644 --- a/mediagoblin/gmg_commands/users.py +++ b/mediagoblin/gmg_commands/users.py @@ -15,6 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from mediagoblin.gmg_commands import util as commands_util +from mediagoblin.gmg_commands.util import option_add_conffile from mediagoblin.auth import lib as auth_lib from mediagoblin import mg_globals @@ -29,9 +30,7 @@ def adduser_parser_setup(subparser): subparser.add_argument( 'email', help="Email to recieve notifications") - subparser.add_argument( - '-cf', '--conf_file', default='mediagoblin.ini', - help="Config file used to set up environment") + option_add_conffile(subparser) def adduser(args): @@ -64,9 +63,7 @@ def makeadmin_parser_setup(subparser): subparser.add_argument( 'username', help="Username to give admin level") - subparser.add_argument( - '-cf', '--conf_file', default='mediagoblin.ini', - help="Config file used to set up environment") + option_add_conffile(subparser) def makeadmin(args): @@ -90,9 +87,7 @@ def changepw_parser_setup(subparser): subparser.add_argument( 'password', help="Your NEW supersecret word to login") - subparser.add_argument( - '-cf', '--conf_file', default='mediagoblin.ini', - help="Config file used to set up environment") + option_add_conffile(subparser) def changepw(args): |