X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=myslice%2Fconfig.py;h=51bf4b7967e0d829f1f9f2166dff0a72a77e5e2a;hb=fc73a99025ba9125c5d3aa2264179af0646e6568;hp=9cf2407253f7b4881faff2be64c5fb5ffdbb78c3;hpb=4a99831db81024d5d25869d4c475d381fd39f75a;p=unfold.git diff --git a/myslice/config.py b/myslice/config.py index 9cf24072..51bf4b79 100644 --- a/myslice/config.py +++ b/myslice/config.py @@ -16,11 +16,15 @@ class Config: # if you use a development backend running on this box, use "http://localhost:7080/" # the INRIA setup is with "http://manifold.pl.sophia.inria.fr:7080/" + default_manifold_admin_user = 'admin' + default_manifold_admin_password = None + _config_parser = None # having grown tired of screwing up with git stashes # taking away my local config, we now more properly use # an external config file to override teh default + # XXX we might use support from manifold util classes --jordan @staticmethod def manifold_url (): if Config._config_parser: @@ -32,6 +36,20 @@ class Config: Config._config_parser=config return Config.manifold_url() + @staticmethod + def manifold_admin_user_password(): + if Config._config_parser: + admin_user = Config._config_parser.get('manifold','admin_user') + admin_password = Config._config_parser.get('manifold','admin_password') + return (admin_user, admin_password) + config = RawConfigParser () + config.add_section('manifold') + config.set ('manifold', 'admin_user', Config.default_manifold_admin_user) + config.set ('manifold', 'admin_password', Config.default_manifold_admin_password) + config.read (os.path.join(ROOT,'myslice/myslice.ini')) + Config._config_parser=config + return Config.manifold_admin_user_password() + # exporting these details to js @staticmethod def manifold_js_export ():