Based on patches by Petr Voborni
Signed-off-by: Simo Sorce <simo@redhat.com>
-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
from jinja2 import Environment, FileSystemLoader
cherrypy.config.update('ipsilon.conf')
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
idp_providers = plugins.get_providers()
if idp_providers:
cherrypy.config['idp_providers'] = idp_providers
-datastore = data.Store()
admin_config = datastore.get_admin_config()
for option in admin_config:
cherrypy.config[option] = admin_config[option]
admin_config = datastore.get_admin_config()
for option in admin_config:
cherrypy.config[option] = admin_config[option]
'/ui': { 'tools.staticdir.on': True,
'tools.staticdir.dir': 'ui' }
}
'/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'
else:
cherrypy.config['environment'] = 'embedded'
cherrypy.engine.start(blocking=False)
atexit.register(cherrypy.engine.stop)
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)
script_name=None, config=None)
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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
def root(self):
return self._template('index.html', title='Root')
def root(self):
return self._template('index.html', title='Root')
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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 ipsilon.util.user import User
import cherrypy
def protect():
import cherrypy
def protect():
def __call__(self, *args, **kwargs):
self.username = cherrypy.session.get('user', None)
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)
if len(args) > 0:
op = getattr(self, args[0], None)
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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 ipsilon.util.data import Store
class Site(object):
def __init__(self, value):
class Site(object):
def __init__(self, value):
self.name = username
def _get_user_data(self, username):
self.name = username
def _get_user_data(self, username):
return store._get_user_preferences(username)
@property
return store._get_user_preferences(username)
@property