# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
from mediagoblin import app
+import getpass
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 is None:
+ if not password:
+ variable=raw_input(text + u' ')
+ else:
+ variable=getpass.getpass(text + u' ')
+
+ return variable