-# an old-fashioned API - that's what is currently only supported
- manifold_url = "http://localhost:7080/"
-# this one runs a new API, but currently (april 2013) there are missing
-# features; GetSession and GetPersons are still there (they should go away) and
-# the code for retrieving metadata does not work as-is, and I have no clue
-# what it should become anyways, so...
-# manifold_url = "http://dev.myslice.info:7080/"
+# use a singleton instead of staticmethods
+from manifold.util.singleton import Singleton
+
+class Config(object):
+ __metaclass__ = Singleton
+
+ # the OpenLab-wide backend as managed by UPMC
+ # xxx production should probably use https of course
+ default_manifold_url = "https://test.myslice.info:7080/"
+ # the devel/unstable version runs on "https://dev.myslice.info:7080/"
+ # if you use a development backend running on this box, use "http://localhost:7080/"
+ # the INRIA setup is with "https://manifold.pl.sophia.inria.fr:7080/"
+
+ default_manifold_admin_user = 'admin'
+ default_manifold_admin_password = 'demo'
+
+
+ def __init__ (self):
+ parser = RawConfigParser ()
+ parser.add_section('manifold')
+ parser.set ('manifold', 'url', Config.default_manifold_url)
+ parser.set ('manifold', 'admin_user', Config.default_manifold_admin_user)
+ parser.set ('manifold', 'admin_password', Config.default_manifold_admin_password)
+ parser.add_section('googlemap')
+ parser.set ('googlemap','api_key', None)
+ parser.read (os.path.join(ROOT,'myslice/myslice.ini'))
+ self.config_parser=parser
+
+ def manifold_url (self):
+ return self.config_parser.get('manifold','url')
+
+ def manifold_admin_user_password(self):
+ return (self.config_parser.get('manifold','admin_user'),
+ self.config_parser.get('manifold','admin_password'))
+
+ def googlemap_api_key (self):
+ return self.config_parser.get('googlemap','api_key')