Pārlūkot izejas kodu

create new txn file if doesn't exist

Daniel Sheffield 8 mēneši atpakaļ
vecāks
revīzija
fc4ef29cc7
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      grocery_transactions.py

+ 3 - 0
grocery_transactions.py

@@ -42,6 +42,9 @@ class GroceryTransactionEditor(WidgetPlaceholder):
         self.cur = cur
         txn: TransactionEditor = self.activity_manager.get('transaction')
 
+        with open(log, 'a') as f:
+            pass
+
         with open(log, 'r') as f:
             date = None
             store = None