forse
authorMauro Scomparin <scompo@gmail.com>
Mon, 16 Sep 2019 20:48:52 +0000 (22:48 +0200)
committerMauro Scomparin <scompo@gmail.com>
Mon, 16 Sep 2019 20:48:52 +0000 (22:48 +0200)
money/money.py

index 07868309a49bfaa56708e8e48b1807fc6e571fb5..a2f3553f1537398f0233dc108569c6f0bb8fdf09 100755 (executable)
@@ -216,7 +216,8 @@ def latest_movements():
     write_latest_movements(data_file, resulting_config)
 
 def mov_filter(movs, filter):
-    return list(filter(lambda m: re.match(filter, m[DESCRIPTION_FIELD_NAME])))
+    p = re.compile(filter)
+    return [m for m in movs if p.match(m[DESCRIPTION_FIELD_NAME])]
 
 def filter_regex_movements(data_file, conf, filter):
     movements = load_file(data_file)