diff --git a/lib/newfol/main.py b/lib/newfol/main.py index 70a3bcf..b2156d7 100644 --- a/lib/newfol/main.py +++ b/lib/newfol/main.py @@ -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):