Corretto importazione.
authorMauro Scomparin <scompo@gmail.com>
Wed, 12 Apr 2017 17:06:02 +0000 (19:06 +0200)
committerMauro Scomparin <scompo@gmail.com>
Wed, 12 Apr 2017 17:06:02 +0000 (19:06 +0200)
utils/estrai.py

index 27675c84f1b8d58f45b20033477e2e3caea0ba8a..daf919554a29e70bc946674a5deee801b1470d47 100755 (executable)
@@ -4,13 +4,12 @@ dati = []
 stato = 0
 with open('dati.quif','r') as f:
     for l in f:
-        if stato == 0 and '!Type:Cash' in l:
+        if stato == 0 and l.startswith('D'):
             stato = 1
             tr = {
-                    'head' : l
+                'head' : l
             }
             dati.append(tr)
-        elif stato == 1 and l.startswith('D'):
             dati[-1]['data'] = l
         elif stato == 1 and l.startswith('M'):
             dati[-1]['descrizione'] = l