From a62074d02be0c9fc340d1d86f5b51a1f92923550 Mon Sep 17 00:00:00 2001 From: Gino D Date: Thu, 29 Dec 2022 17:41:23 +0100 Subject: [PATCH] Enable to see sessions items --- pybash => picowatch | 2 +- {picowatch => picowatch_d}/picowatch.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) rename pybash => picowatch (69%) rename {picowatch => picowatch_d}/picowatch.py (98%) diff --git a/pybash b/picowatch similarity index 69% rename from pybash rename to picowatch index cb3d978..03f5839 100644 --- a/pybash +++ b/picowatch @@ -1,3 +1,3 @@ #!/bin/bash -python "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/$1/$1.py" $(pwd) \ No newline at end of file +python "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/picowatch_d/picowatch.py" \ No newline at end of file diff --git a/picowatch/picowatch.py b/picowatch_d/picowatch.py similarity index 98% rename from picowatch/picowatch.py rename to picowatch_d/picowatch.py index cceb39e..bd99626 100644 --- a/picowatch/picowatch.py +++ b/picowatch_d/picowatch.py @@ -920,7 +920,7 @@ def ls(source: str = '/'): filename = filename[1:] if len(filename) > 5: - print(f'→ {filename}') + print('→', filename) except Exception as e: print(f'Exeception: ls({source}): {str(e)}') @@ -1006,6 +1006,15 @@ try: download(source) case ['' | 'save']: watchdog_callback() + case ['commits']: + for filename in sessions['deleted']: + print('↺', filename) + + for filename in sessions['modified']: + print('⇈', filename) + case ['revert']: + sessions['deleted'] = set() + sessions['modified'] = set() case _: if message.startswith('./'): launch(message[2:])