Use pep8 check
authorPetr Vobornik <pvoborni@redhat.com>
Thu, 23 Jan 2014 17:11:26 +0000 (18:11 +0100)
committerSimo Sorce <simo@redhat.com>
Fri, 24 Jan 2014 22:32:21 +0000 (17:32 -0500)
Signed-off-by: Petr Vobornik <pvoborni@redhat.com>
Signed-off-by: Simo Sorce <simo@redhat.com>
Makefile
ipsilon/idpserver.py
ipsilon/root.py
ipsilon/util/data.py
ipsilon/util/page.py
ipsilon/util/plugin.py
ipsilon/util/user.py

index 7d81f00..edd68f0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-all: lint
+all: lint pep8
 
 lint:
        # Analyze code
@@ -9,3 +9,7 @@ lint:
                   --notes= \
                   --ignored-classes=cherrypy \
                   ./ipsilon
+
+pep8:
+       # Check style consistency
+       pep8 ipsilon
index a10f175..e260043 100755 (executable)
@@ -47,10 +47,9 @@ env = Environment(loader=FileSystemLoader(templates))
 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:
index cd64ef3..e445dc5 100755 (executable)
@@ -19,6 +19,7 @@
 
 from ipsilon.util.page import Page
 
+
 class Root(Page):
 
     def root(self):
index 858fa55..15bf5b7 100755 (executable)
@@ -21,6 +21,7 @@ import os
 import sqlite3
 import cherrypy
 
+
 class Store(object):
 
     def __init__(self, path=None):
@@ -91,7 +92,7 @@ class Store(object):
             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()
index a7e2035..18b5be2 100755 (executable)
@@ -20,6 +20,7 @@
 from ipsilon.util.user import User
 import cherrypy
 
+
 def protect():
     if cherrypy.request.login:
         user = cherrypy.session.get('user', None)
@@ -29,6 +30,7 @@ def protect():
             cherrypy.session.regenerate()
             cherrypy.session['user'] = cherrypy.request.login
 
+
 class Page(object):
     def __init__(self, template_env):
         self._env = template_env
index 2db88dd..917f28b 100755 (executable)
@@ -21,6 +21,7 @@ import os
 import imp
 import cherrypy
 
+
 class Plugins(object):
 
     def __init__(self, path=None):
index 6c5fc51..ccca9fb 100755 (executable)
 
 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:
@@ -76,4 +78,3 @@ class User(object):
     def sites(self):
         #TODO: implement setting sites via the user object ?
         raise AttributeError
-