Signed-off-by: Petr Vobornik <pvoborni@redhat.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
--notes= \
--ignored-classes=cherrypy \
./ipsilon
--notes= \
--ignored-classes=cherrypy \
./ipsilon
+
+pep8:
+ # Check style consistency
+ pep8 ipsilon
cherrypy.tools.protect = cherrypy.Tool('before_handler', page.protect)
if __name__ == "__main__":
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:
cherrypy.quickstart(Root(env), '/', conf)
else:
from ipsilon.util.page import Page
from ipsilon.util.page import Page
class Root(Page):
def root(self):
class Root(Page):
def root(self):
import sqlite3
import cherrypy
import sqlite3
import cherrypy
class Store(object):
def __init__(self, path=None):
class Store(object):
def __init__(self, path=None):
if con:
con.rollback()
cherrypy.log.error("Failed to load %s's prefs from "
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()
finally:
if con:
con.close()
from ipsilon.util.user import User
import cherrypy
from ipsilon.util.user import User
import cherrypy
def protect():
if cherrypy.request.login:
user = cherrypy.session.get('user', None)
def protect():
if cherrypy.request.login:
user = cherrypy.session.get('user', None)
cherrypy.session.regenerate()
cherrypy.session['user'] = cherrypy.request.login
cherrypy.session.regenerate()
cherrypy.session['user'] = cherrypy.request.login
class Page(object):
def __init__(self, template_env):
self._env = template_env
class Page(object):
def __init__(self, template_env):
self._env = template_env
import imp
import cherrypy
import imp
import cherrypy
class Plugins(object):
def __init__(self, path=None):
class Plugins(object):
def __init__(self, path=None):
from ipsilon.util.data import Store
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 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:
class User(object):
def __init__(self, username):
if username is None:
def sites(self):
#TODO: implement setting sites via the user object ?
raise AttributeError
def sites(self):
#TODO: implement setting sites via the user object ?
raise AttributeError