Make status logging conditional
parent
4f9b717d31
commit
ab827c0df4
6
toldg.py
6
toldg.py
|
@ -222,7 +222,8 @@ def render_to_file(transactions: List[Transaction], csv_file: str, ledger_file:
|
||||||
with open(ledger_file, 'w') as f:
|
with open(ledger_file, 'w') as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
status = "update"
|
status = "update"
|
||||||
logging.info(f"{csv_file:30} -> {ledger_file:30} | {status}")
|
if status != "no change":
|
||||||
|
logging.info(f"{csv_file:30} -> {ledger_file:30} | {status}")
|
||||||
|
|
||||||
|
|
||||||
def write_mappings(unmatched_transactions: List[Transaction], mappings_directory: str):
|
def write_mappings(unmatched_transactions: List[Transaction], mappings_directory: str):
|
||||||
|
@ -272,7 +273,8 @@ def process_ldg_file(ldg_file: str, config: Config):
|
||||||
if file_age(dest_file) > file_age(ldg_file):
|
if file_age(dest_file) > file_age(ldg_file):
|
||||||
shutil.copy(ldg_file, dest_file)
|
shutil.copy(ldg_file, dest_file)
|
||||||
status = "update"
|
status = "update"
|
||||||
logging.info(f"{ldg_file:30} -> {dest_file:30} | {status}")
|
if status != "no change":
|
||||||
|
logging.info(f"{ldg_file:30} -> {dest_file:30} | {status}")
|
||||||
|
|
||||||
|
|
||||||
def main(config):
|
def main(config):
|
||||||
|
|
Loading…
Reference in New Issue