Fix Imports
authorSimo Sorce <simo@redhat.com>
Fri, 24 Jan 2014 20:57:28 +0000 (15:57 -0500)
committerSimo Sorce <simo@redhat.com>
Fri, 24 Jan 2014 22:31:56 +0000 (17:31 -0500)
Based on patches by Petr Voborni

Signed-off-by: Simo Sorce <simo@redhat.com>
ipsilon/idpserver.py
ipsilon/root.py
ipsilon/util/page.py
ipsilon/util/user.py

index 7a782d6..a10f175 100755 (executable)
@@ -22,22 +22,21 @@ sys.stdout = sys.stderr
 
 import os
 import atexit
-import threading
 import cherrypy
-from util import plugin
-from util import data
-from util import page
+from ipsilon.util.plugin import Plugins
+from ipsilon.util.data import Store
+from ipsilon.util import page
+from ipsilon.root import Root
 from jinja2 import Environment, FileSystemLoader
-import root
 
 cherrypy.config.update('ipsilon.conf')
 
-plugins = plugin.Plugins(path=cherrypy.config['base.dir'])
+plugins = Plugins(path=cherrypy.config['base.dir'])
 idp_providers = plugins.get_providers()
 if idp_providers:
     cherrypy.config['idp_providers'] = idp_providers
 
-datastore = data.Store()
+datastore = Store()
 admin_config = datastore.get_admin_config()
 for option in admin_config:
     cherrypy.config[option] = admin_config[option]
@@ -52,7 +51,7 @@ if __name__ == "__main__":
              '/ui': { 'tools.staticdir.on': True,
                       'tools.staticdir.dir': 'ui' }
            }
-    cherrypy.quickstart(root.Root(env), '/', conf)
+    cherrypy.quickstart(Root(env), '/', conf)
 
 else:
     cherrypy.config['environment'] = 'embedded'
@@ -61,5 +60,5 @@ else:
         cherrypy.engine.start(blocking=False)
         atexit.register(cherrypy.engine.stop)
 
-    application = cherrypy.Application(root.Root(env),
+    application = cherrypy.Application(Root(env),
                                        script_name=None, config=None)
index a352641..cd64ef3 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from util import page
-import cherrypy
+from ipsilon.util.page import Page
 
-class Root(page.Page):
+class Root(Page):
 
     def root(self):
         return self._template('index.html', title='Root')
index 15cbed0..a99ece8 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from util import user
+from ipsilon.util.user import User
 import cherrypy
 
 def protect():
@@ -37,7 +37,7 @@ class Page(object):
 
     def __call__(self, *args, **kwargs):
         self.username = cherrypy.session.get('user', None)
-        self.user = user.User(self.username)
+        self.user = User(self.username)
 
         if len(args) > 0:
             op = getattr(self, args[0], None)
index 1241340..3b58724 100755 (executable)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from util import data
+from ipsilon.util.data import Store
 
 class Site(object):
     def __init__(self, value):
@@ -35,7 +35,7 @@ class User(object):
             self.name = username
 
     def _get_user_data(self, username):
-        store = data.Store()
+        store = Store()
         return store._get_user_preferences(username)
 
     @property