Fix remianing flake8 ENNN and WNNN problems
authorKarl O. Pinc <kop@meme.com>
Sun, 21 Oct 2018 23:23:19 +0000 (18:23 -0500)
committerKarl O. Pinc <kop@meme.com>
Sun, 21 Oct 2018 23:58:53 +0000 (18:58 -0500)
src/pgwui_core/pgwui_core.py

index a1e979fc02581ac6b7cd3e9982f14937a1397beb..1ad4a1553b46ff4382638e4933f7642f994118a1 100644 (file)
@@ -289,8 +289,8 @@ class CredsLoadedForm(LoadedForm):
         Produces the dict pyramid will use to render the form.
         '''
         response = super(CredsLoadedForm, self).write(result, errors)
-        if ('havecreds' not in response
-            or ('havecreds' in response and not response['havecreds'])):
+        if ('havecreds' not in response or
+                ('havecreds' in response and not response['havecreds'])):
             # We don't know if the credentials are good or
             # we know they are bad.  Keep them out of the session.
             response['user'] = ''
@@ -1019,7 +1019,7 @@ class UploadData(DBData):
                 self.lineno += 1
                 # Intuit the eol sequence
                 if line[-2:] == '\r\n':
-                    eol = '\r\n';
+                    eol = '\r\n'
                     line = line[:-2]
                 elif line[-1:] == '\n':
                     eol = '\n'
@@ -1071,9 +1071,10 @@ class UploadData(DBData):
         # Create mapper to frob data elements
         if null_data:
             null_rep = do_trim(null_rep)
-            # psycopg2 maps None to NULL
+
             def mapper(st):
                 st = do_trim(st)
+                # psycopg2 maps None to NULL
                 return None if st == null_rep else st
             self._mapper = mapper
         else:
@@ -1359,10 +1360,10 @@ class UploadHandler(SessionDBHandler):
         uf = self.uf
         if self.make_double_key() == uf['last_key']:
             errors.append(DuplicateUploadError(
-                    'File just uploaded to this db',
-                    ('File named ({0}) just uploaded'
-                     .format(markupsafe.escape(uf['filename']))),
-                    '<p>Try again to force upload.</p>'))
+                'File just uploaded to this db',
+                ('File named ({0}) just uploaded'
+                 .format(markupsafe.escape(uf['filename']))),
+                '<p>Try again to force upload.</p>'))
 
     def hash_sequence(self, seq):
         '''Produce a hash of the elements of a sequence.'''
@@ -1420,8 +1421,8 @@ class UploadHandler(SessionDBHandler):
         if hasattr(self, 'data'):
             response['lines'] = self.data.lineno - 1
         response['e_cnt'] = len(errors)
-        response['db_changed'] = (not response['errors']
-                                  and self.uf['action'] != '')
+        response['db_changed'] = (not response['errors'] and
+                                  self.uf['action'] != '')
         return response
 
 
@@ -1631,7 +1632,7 @@ class DBConnector(object):
                 errors = self.call_alter_db(func, conn)
 
         response.update({'havecreds': havecreds
-                 })
+                         })
         return (errors, response)
 
     def read_uh(self):