From 47ff1fb4cd7a6c416c93246decacd19628b232c3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 24 Jan 2014 15:57:28 -0500 Subject: [PATCH] Fix Imports Based on patches by Petr Voborni Signed-off-by: Simo Sorce --- ipsilon/idpserver.py | 17 ++++++++--------- ipsilon/root.py | 5 ++--- ipsilon/util/page.py | 4 ++-- ipsilon/util/user.py | 4 ++-- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ipsilon/idpserver.py b/ipsilon/idpserver.py index 7a782d6..a10f175 100755 --- a/ipsilon/idpserver.py +++ b/ipsilon/idpserver.py @@ -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) diff --git a/ipsilon/root.py b/ipsilon/root.py index a352641..cd64ef3 100755 --- a/ipsilon/root.py +++ b/ipsilon/root.py @@ -17,10 +17,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -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') diff --git a/ipsilon/util/page.py b/ipsilon/util/page.py index 15cbed0..a99ece8 100755 --- a/ipsilon/util/page.py +++ b/ipsilon/util/page.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -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) diff --git a/ipsilon/util/user.py b/ipsilon/util/user.py index 1241340..3b58724 100755 --- a/ipsilon/util/user.py +++ b/ipsilon/util/user.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -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 -- 2.20.1