Updating converter to pick up files copied in by nextcloud

This commit is contained in:
2022-09-23 15:06:20 +10:00
parent ed85763ff5
commit 9ce052e04d

View File

@@ -153,6 +153,7 @@ class Handler(watchdog.events.PatternMatchingEventHandler):
logging.info("file copy has now finished")
with open(event.src_path, 'r') as file:
try:
qfx = OfxParser.parse(file, fail_fast=False)
statement, acct_name = Handler.get_statement_from_qfx(qfx)
@@ -176,11 +177,15 @@ class Handler(watchdog.events.PatternMatchingEventHandler):
if not destination.exists():
path.replace(destination)
except:
logging.info("Failed to process {}".format(event.src_path))
logging.info("Processing successfully finished for {}".format(event.src_path))
def on_created(self, event):
logging.info('{} on {}'.format(event.event_type, event.src_path))
def on_modified(self, event):
logging.info('Found modified file: {}'.format(event.src_path))
self.on_created(event)
if __name__ == "__main__":