-all: lint
+all: lint pep8
lint:
# Analyze code
--notes= \
--ignored-classes=cherrypy \
./ipsilon
+
+pep8:
+ # Check style consistency
+ pep8 ipsilon
cherrypy.tools.protect = cherrypy.Tool('before_handler', page.protect)
if __name__ == "__main__":
- conf = { '/': {'tools.staticdir.root': os.getcwd()},
- '/ui': { 'tools.staticdir.on': True,
- 'tools.staticdir.dir': 'ui' }
- }
+ conf = {'/': {'tools.staticdir.root': os.getcwd()},
+ '/ui': {'tools.staticdir.on': True,
+ 'tools.staticdir.dir': 'ui'}}
cherrypy.quickstart(Root(env), '/', conf)
else:
from ipsilon.util.page import Page
+
class Root(Page):
def root(self):
import sqlite3
import cherrypy
+
class Store(object):
def __init__(self, path=None):
if con:
con.rollback()
cherrypy.log.error("Failed to load %s's prefs from "
- "%s: [%s]" % ( user, dbname, e))
+ "%s: [%s]" % (user, dbname, e))
finally:
if con:
con.close()
from ipsilon.util.user import User
import cherrypy
+
def protect():
if cherrypy.request.login:
user = cherrypy.session.get('user', None)
cherrypy.session.regenerate()
cherrypy.session['user'] = cherrypy.request.login
+
class Page(object):
def __init__(self, template_env):
self._env = template_env
import imp
import cherrypy
+
class Plugins(object):
def __init__(self, path=None):
from ipsilon.util.data import Store
+
class Site(object):
def __init__(self, value):
# implement lookup of sites id for link/name
self.link = value
self.name = value
+
class User(object):
def __init__(self, username):
if username is None:
def sites(self):
#TODO: implement setting sites via the user object ?
raise AttributeError
-