From a65099c1afa18f1989810db351819b79c117f594 Mon Sep 17 00:00:00 2001
From: Florian Apolloner <florian@apolloner.eu>
Date: Apr 07 2017 13:39:59 +0000
Subject: Format code according to PEP8.


Signed-off-by: Florian Apolloner <florian@apolloner.eu>

---

diff --git a/ipsilon/providers/openid/extensions/common.py b/ipsilon/providers/openid/extensions/common.py
index 247584c..258fad8 100644
--- a/ipsilon/providers/openid/extensions/common.py
+++ b/ipsilon/providers/openid/extensions/common.py
@@ -2,7 +2,6 @@
 
 from __future__ import absolute_import
 
-from ipsilon.providers.common import FACILITY
 from ipsilon.util.plugin import PluginLoader
 from ipsilon.util.log import Log
 
diff --git a/ipsilon/providers/saml2/sessions.py b/ipsilon/providers/saml2/sessions.py
index f8fb369..6e2b1bf 100644
--- a/ipsilon/providers/saml2/sessions.py
+++ b/ipsilon/providers/saml2/sessions.py
@@ -282,6 +282,7 @@ class SAMLSessionFactory(Log):
             self.debug('session %d: %s' % (count, samlsession.convert()))
             count += 1
 
+
 if __name__ == '__main__':
     provider1 = "http://127.0.0.10/saml2"
     provider2 = "http://127.0.0.11/saml2"
diff --git a/ipsilon/util/log.py b/ipsilon/util/log.py
index 4350629..c776d14 100644
--- a/ipsilon/util/log.py
+++ b/ipsilon/util/log.py
@@ -252,6 +252,7 @@ def log_request_response():
     f.close()
     print string
 
+
 cherrypy.tools.log_request_response = cherrypy.Tool('on_end_resource',
                                                     log_request_response)
 
diff --git a/ipsilon/util/policy.py b/ipsilon/util/policy.py
index 0501870..8826086 100644
--- a/ipsilon/util/policy.py
+++ b/ipsilon/util/policy.py
@@ -371,6 +371,7 @@ class Policy(Log):
 
         return allowed
 
+
 # Unit tests
 if __name__ == '__main__':
 
diff --git a/quickrun.py b/quickrun.py
index 4cc4bc4..2bbe16d 100755
--- a/quickrun.py
+++ b/quickrun.py
@@ -19,8 +19,8 @@ logger = None
 
 
 def parse_args():
-    parser = argparse.ArgumentParser(description=\
-        'Run a test Ipsilon instance from the checkout directory')
+    parser = argparse.ArgumentParser(description='Run a test Ipsilon instance '
+                                                 'from the checkout directory')
     parser.add_argument('--workdir', default=os.path.join(os.getcwd(), 'qrun'),
                         help="Directory in which db/session files are stored")
     parser.add_argument('--cleanup', '-c', action='store_true', default=False,
@@ -28,9 +28,9 @@ def parse_args():
     return vars(parser.parse_args())
 
 
-CONF_TEMPLATE="templates/install/ipsilon.conf"
+CONF_TEMPLATE = "templates/install/ipsilon.conf"
 
-ADMIN_TEMPLATE='''
+ADMIN_TEMPLATE = '''
 CREATE TABLE login_config (name TEXT,option TEXT,value TEXT);
 INSERT INTO login_config VALUES('global', 'enabled', 'testauth');
 CREATE TABLE provider_config (name TEXT,option TEXT,value TEXT);
@@ -45,12 +45,13 @@ CREATE TABLE authz_config (name TEXT,option TEXT,value TEXT);
 INSERT INTO authz_config VALUES('global', 'enabled', 'allow');
 '''
 
-USERS_TEMPLATE='''
+USERS_TEMPLATE = '''
 CREATE TABLE users(name TEXT, option TEXT, value TEXT);
 INSERT INTO users VALUES('admin', 'is_admin', '1');
 CREATE TABLE user_consent(name TEXT, option TEXT, value TEXT);
 '''
 
+
 def config(workdir):
     os.makedirs(workdir)
     os.makedirs(os.path.join(workdir, 'sessions'))
@@ -94,7 +95,7 @@ def config(workdir):
                          'secure': 'False',
                          'cleanup_interval': 1,
                          'session_timeout': 30,
-                        })
+                         })
     conf = os.path.join(workdir, 'ipsilon.conf')
     with open(conf, 'w+') as f:
         f.write(text)
@@ -118,7 +119,7 @@ def init(workdir):
     rsasig = JWK(generate='RSA', size=2048, use='sig', kid='quickstart')
     keyset.add(rsasig)
     with open(keyfile, 'w') as m:
-	m.write(keyset.export())
+        m.write(keyset.export())
 
 
 if __name__ == '__main__':
@@ -129,7 +130,8 @@ if __name__ == '__main__':
     penv.update(os.environ)
     penv['PYTHONPATH'] = os.getcwd()
 
-    schema_init = os.path.join(os.getcwd(), 'ipsilon/install/ipsilon-upgrade-database')
+    schema_init = os.path.join(os.getcwd(),
+                               'ipsilon/install/ipsilon-upgrade-database')
     exe = os.path.join(os.getcwd(), 'ipsilon/ipsilon')
 
     if args['cleanup']:
diff --git a/setup.py b/setup.py
index 6ee74e4..3508e65 100755
--- a/setup.py
+++ b/setup.py
@@ -8,58 +8,57 @@ from glob import glob
 DATA = 'share/ipsilon/'
 
 setup(
-    name = 'ipsilon',
-    version = '2.0.2',
-    license = 'GPLv3+',
-    maintainer = 'Ipsilon project Contributors',
-    maintainer_email = 'ipsilon@lists.fedorahosted.org',
+    name='ipsilon',
+    version='2.0.2',
+    license='GPLv3+',
+    maintainer='Ipsilon project Contributors',
+    maintainer_email='ipsilon@lists.fedorahosted.org',
     url='https://fedorahosted.org/ipsilon/',
-    packages = ['ipsilon', 'ipsilon.admin', 'ipsilon.rest',
-                'ipsilon.login', 'ipsilon.info', 'ipsilon.util',
-                'ipsilon.providers', 'ipsilon.providers.saml2',
-                'ipsilon.providers.openid',
-                'ipsilon.providers.openid.extensions',
-                'ipsilon.providers.openidc',
-                'ipsilon.providers.openidc.plugins',
-                'ipsilon.providers.persona',
-                'ipsilon.authz', 'ipsilon.user',
-                'ipsilon.tools', 'ipsilon.helpers',
-                'tests', 'tests.helpers'],
-    data_files = [('share/man/man7', ['man/ipsilon.7']),
-                  ('share/man/man5', ['man/ipsilon.conf.5']),
-                  ('share/man/man1', ['man/ipsilon-client-install.1',
-                                      'man/ipsilon-server-install.1']),
-                  ('share/doc/ipsilon', ['COPYING', 'README.md']),
-                  ('share/doc/ipsilon/examples', ['examples/ipsilon.conf',
-                                                  'examples/apache.conf']),
-                  (DATA+'ui/css', glob('ui/css/*.css')),
-                  (DATA+'ui/img', glob('ui/img/*')),
-                  (DATA+'ui/js', glob('ui/js/*.js')),
-                  (DATA+'ui/fonts-local', glob('ui/fonts-local/*')),
-                  (DATA+'ui/saml2sp', glob('ui/saml2sp/*.html')),
-                  (DATA+'templates', glob('templates/*.html')),
-                  (DATA+'templates/user', glob('templates/user/*.html')),
-                  (DATA+'templates/admin', glob('templates/admin/*.html')),
-                  (DATA+'templates/admin', glob('templates/admin/*.svg')),
-                  (DATA+'templates/login', glob('templates/login/*.html')),
-                  (DATA+'templates/saml2', glob('templates/saml2/*.html')),
-                  (DATA+'templates/openid', glob('templates/openid/*')),
-                  (DATA+'templates/openidc', glob('templates/openidc/*')),
-                  (DATA+'templates/persona', glob('templates/persona/*.html')),
-                  (DATA+'templates/install', glob('templates/install/*.conf')),
-                  (DATA+'templates/install/openidc',
-                   glob('templates/install/openidc/*.conf')),
-                  (DATA+'templates/install/pam',
-                   glob('templates/install/pam/*.pamd')),
-                  (DATA+'templates/install/saml2',
-                   glob('templates/install/saml2/*.conf')),
-                  (DATA+'templates/admin/providers',
-                   glob('templates/admin/providers/*.html')),
-                 ],
-    scripts = ['ipsilon/ipsilon',
-               'ipsilon/install/ipsilon-db2conf',
-               'ipsilon/install/ipsilon-upgrade-database',
-               'ipsilon/install/ipsilon-server-install',
-               'ipsilon/install/ipsilon-client-install']
+    packages=['ipsilon', 'ipsilon.admin', 'ipsilon.rest',
+              'ipsilon.login', 'ipsilon.info', 'ipsilon.util',
+              'ipsilon.providers', 'ipsilon.providers.saml2',
+              'ipsilon.providers.openid',
+              'ipsilon.providers.openid.extensions',
+              'ipsilon.providers.openidc',
+              'ipsilon.providers.openidc.plugins',
+              'ipsilon.providers.persona',
+              'ipsilon.authz', 'ipsilon.user',
+              'ipsilon.tools', 'ipsilon.helpers',
+              'tests', 'tests.helpers'],
+    data_files=[('share/man/man7', ['man/ipsilon.7']),
+                ('share/man/man5', ['man/ipsilon.conf.5']),
+                ('share/man/man1', ['man/ipsilon-client-install.1',
+                                    'man/ipsilon-server-install.1']),
+                ('share/doc/ipsilon', ['COPYING', 'README.md']),
+                ('share/doc/ipsilon/examples', ['examples/ipsilon.conf',
+                                                'examples/apache.conf']),
+                (DATA+'ui/css', glob('ui/css/*.css')),
+                (DATA+'ui/img', glob('ui/img/*')),
+                (DATA+'ui/js', glob('ui/js/*.js')),
+                (DATA+'ui/fonts-local', glob('ui/fonts-local/*')),
+                (DATA+'ui/saml2sp', glob('ui/saml2sp/*.html')),
+                (DATA+'templates', glob('templates/*.html')),
+                (DATA+'templates/user', glob('templates/user/*.html')),
+                (DATA+'templates/admin', glob('templates/admin/*.html')),
+                (DATA+'templates/admin', glob('templates/admin/*.svg')),
+                (DATA+'templates/login', glob('templates/login/*.html')),
+                (DATA+'templates/saml2', glob('templates/saml2/*.html')),
+                (DATA+'templates/openid', glob('templates/openid/*')),
+                (DATA+'templates/openidc', glob('templates/openidc/*')),
+                (DATA+'templates/persona', glob('templates/persona/*.html')),
+                (DATA+'templates/install', glob('templates/install/*.conf')),
+                (DATA+'templates/install/openidc',
+                 glob('templates/install/openidc/*.conf')),
+                (DATA+'templates/install/pam',
+                 glob('templates/install/pam/*.pamd')),
+                (DATA+'templates/install/saml2',
+                 glob('templates/install/saml2/*.conf')),
+                (DATA+'templates/admin/providers',
+                 glob('templates/admin/providers/*.html')),
+                ],
+    scripts=['ipsilon/ipsilon',
+             'ipsilon/install/ipsilon-db2conf',
+             'ipsilon/install/ipsilon-upgrade-database',
+             'ipsilon/install/ipsilon-server-install',
+             'ipsilon/install/ipsilon-client-install']
 )
-
diff --git a/tests/testgssapi.py b/tests/testgssapi.py
index 63731f7..db89c3d 100755
--- a/tests/testgssapi.py
+++ b/tests/testgssapi.py
@@ -139,6 +139,7 @@ class IpsilonTest(IpsilonTestBase):
         print "Starting second SP's httpd server"
         self.start_http_server(conf, env)
 
+
 if __name__ == '__main__':
 
     idpname = 'idp1'

