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'] = ''
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'
# 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:
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.'''
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
errors = self.call_alter_db(func, conn)
response.update({'havecreds': havecreds
- })
+ })
return (errors, response)
def read_uh(self):