main: fix pyflakes warning.

pep8 wants the functions written as defs, not lambdas, but pyflakes
complains if we redefine the same function.  Change the code to define
two functions and use a ternary expression to select the one we want.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
brian m. carlson 2015-11-15 16:44:37 +00:00
parent 0d9604b987
commit 8710698880
No known key found for this signature in database
GPG key ID: BF535D811F52F68B

View file

@ -1137,12 +1137,13 @@ def export_from(db, table, dbtype):
def f(x):
return True
def g(x):
return x.table == table
if table is None and dbtype == "csv":
raise newfol.exception.NewfolError(_("A table is required for csv"))
if table is not None:
def f(x):
x.table == table
vault.store(db.records(f))
func = f if table is None else g
vault.store(db.records(func))
def parse_args(args):