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]
'/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'
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)
# 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')
# 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():
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)
# 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):
self.name = username
def _get_user_data(self, username):
- store = data.Store()
+ store = Store()
return store._get_user_preferences(username)
@property