diff options
Diffstat (limited to 'python/etatsbasen.py')
-rwxr-xr-x | python/etatsbasen.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/python/etatsbasen.py b/python/etatsbasen.py index 24e6267..65785a3 100755 --- a/python/etatsbasen.py +++ b/python/etatsbasen.py @@ -38,6 +38,8 @@ rename = { def filter_orgstructid(row, categories): if row == None: return None + if len(categories) == 1 and categories[0] == "all": + return row if int(row["orgstructid"]) in categories: return row else: @@ -61,7 +63,6 @@ def filter_email(row): return row - def printCSV(options): print(options) with open(options["inputfile"], newline='') as csvfile: @@ -100,7 +101,10 @@ if __name__ == "__main__": else: options["headers"] = None try: - options["categories"] = [ int(x) for x in args.c.split(',') ] + if args.c == "all": + options["categories"] = ["all"] + else: + options["categories"] = [ int(x) for x in args.c.split(',') ] except ValueError as ve: print("Failed to parse \"-c %s\"; Categories must comma separated list of only integers" % (args.c), file=sys.stderr) sys.exit(0) |