Fixed some more flake8 warnings

This commit is contained in:
2019-05-12 09:20:33 +02:00
parent 3440047dc2
commit 8abab57c06
3 changed files with 12 additions and 7 deletions

View File

@@ -1 +1,3 @@
from .BioLogic import MPTfile, MPRfile from .BioLogic import MPRfile, MPTfile
__all__ = ['MPRfile', 'MPTfile']

View File

@@ -377,7 +377,7 @@ def mdb_get_data_text(s3db, filename, table):
s3db.execute(insert_match.group()) s3db.execute(insert_match.group())
mdb_output = mdb_output[insert_match.end():] mdb_output = mdb_output[insert_match.end():]
s3db.commit() s3db.commit()
except: except BaseException:
print("Error while importing %s" % table) print("Error while importing %s" % table)
print("Remaining mdb-export output:", mdb_output) print("Remaining mdb-export output:", mdb_output)
if insert_match: if insert_match:
@@ -398,8 +398,11 @@ def mdb_get_data_numeric(s3db, filename, table):
quoted_headers = ['"%s"' % h for h in mdb_headers] quoted_headers = ['"%s"' % h for h in mdb_headers]
joined_headers = ', '.join(quoted_headers) joined_headers = ', '.join(quoted_headers)
joined_placemarks = ', '.join(['?' for h in mdb_headers]) joined_placemarks = ', '.join(['?' for h in mdb_headers])
insert_stmt = 'INSERT INTO "{0}" ({1}) VALUES ({2});'.format(table, insert_stmt = 'INSERT INTO "{0}" ({1}) VALUES ({2});'.format(
joined_headers, joined_placemarks) table,
joined_headers,
joined_placemarks,
)
s3db.executemany(insert_stmt, mdb_csv) s3db.executemany(insert_stmt, mdb_csv)
s3db.commit() s3db.commit()
finally: finally:

View File

@@ -129,7 +129,7 @@ def assert_MPR_matches_MPT(mpr, mpt, comments):
assert_array_equal(mpr.get_flag("control changes"), mpt["control changes"]) assert_array_equal(mpr.get_flag("control changes"), mpt["control changes"])
if "Ns changes" in mpt.dtype.fields: if "Ns changes" in mpt.dtype.fields:
assert_array_equal(mpr.get_flag("Ns changes"), mpt["Ns changes"]) assert_array_equal(mpr.get_flag("Ns changes"), mpt["Ns changes"])
## Nothing uses the 0x40 bit of the flags # Nothing uses the 0x40 bit of the flags
assert_array_equal(mpr.get_flag("counter inc."), mpt["counter inc."]) assert_array_equal(mpr.get_flag("counter inc."), mpt["counter inc."])
assert_array_almost_equal(mpr.data["time/s"], assert_array_almost_equal(mpr.data["time/s"],