diff options
author | Manuel Urbano Santos <mu@member.fsf.org> | 2011-12-03 15:36:02 +0100 |
---|---|---|
committer | Manuel Urbano Santos <mu@member.fsf.org> | 2011-12-03 15:36:02 +0100 |
commit | 7d98005a6b2469134adcf84b7a7417a24968bd8d (patch) | |
tree | d7c909f2a8e2e26cc6aa33ecf811b5b26a1dbca9 /mediagoblin/gmg_commands/util.py | |
parent | d463055317e5518adf7c5a99b4724f4e66830b3c (diff) | |
download | mediagoblin-7d98005a6b2469134adcf84b7a7417a24968bd8d.tar.lz mediagoblin-7d98005a6b2469134adcf84b7a7417a24968bd8d.tar.xz mediagoblin-7d98005a6b2469134adcf84b7a7417a24968bd8d.zip |
Prompt for arguments in adduser if not present (I created a function in util.py to check and prompt for arguments).
Diffstat (limited to 'mediagoblin/gmg_commands/util.py')
-rw-r--r-- | mediagoblin/gmg_commands/util.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mediagoblin/gmg_commands/util.py b/mediagoblin/gmg_commands/util.py index 168a0760..af172105 100644 --- a/mediagoblin/gmg_commands/util.py +++ b/mediagoblin/gmg_commands/util.py @@ -16,6 +16,7 @@ from mediagoblin import app +import getpass def setup_app(args): @@ -25,3 +26,15 @@ def setup_app(args): mgoblin_app = app.MediaGoblinApp(args.conf_file) return mgoblin_app + +def prompt_if_not_set(variable,text,password=False): + """ + Checks if the variable is None and prompt for a value if it is + """ + if (variable==None): + if not password: + variable=raw_input(text+' ') + else: + variable=getpass.getpass(text) + + return variable |