From 05c160cf0e6b6b3007b5aedb187bf3b73faeb836 Mon Sep 17 00:00:00 2001 From: Peter Reutemann Date: Thu, 10 Dec 2020 16:17:31 +1300 Subject: [PATCH] keyboard_interrupt method is now public; prepared for release --- CHANGES.rst | 6 ++++++ setup.py | 2 +- src/sfp/_poller.py | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index bbace91..a8b8fb0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,12 @@ Changelog ========= +0.0.7 (2020-12-10) +------------------ + +- `keyboard_interrupt` method is now public + + 0.0.6 (2020-12-10) ------------------ diff --git a/setup.py b/setup.py index f61fc71..ba0339b 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def _read(f): install_requires=[ "watchdog", ], - version="0.0.6", + version="0.0.7", author='Peter Reutemann', author_email='fracpete@waikato.ac.nz', ) diff --git a/src/sfp/_poller.py b/src/sfp/_poller.py index 33c1d56..123a359 100644 --- a/src/sfp/_poller.py +++ b/src/sfp/_poller.py @@ -292,7 +292,7 @@ def _log(self, type, *args): else: self._logging(type, *args) - def _keyboard_interrupt(self): + def keyboard_interrupt(self): """ Prints an error message and stops the polling. """ @@ -431,7 +431,7 @@ def list_files(self): self.error("Flagged as incomplete %d times, skipping" % self.blacklist_tries) os.rename(k, os.path.join(self.output_dir, os.path.basename(k))) except KeyboardInterrupt: - self._keyboard_interrupt() + self.keyboard_interrupt() return except: self.error(traceback.format_exc()) @@ -448,7 +448,7 @@ def list_files(self): self.debug("Finished listing files") except KeyboardInterrupt: - self._keyboard_interrupt() + self.keyboard_interrupt() return except: self.error("Failed listing files!") @@ -510,7 +510,7 @@ def process_files(self, file_list: List[str]): self.debug("Moving other input %s to %s" % (other_path, self.output_dir)) os.rename(other_path, os.path.join(self.output_dir, os.path.basename(other_path))) except KeyboardInterrupt: - self._keyboard_interrupt() + self.keyboard_interrupt() return except: self.error("Failed processing: %s" % file_path) @@ -522,7 +522,7 @@ def process_files(self, file_list: List[str]): self.info("Finished processing: %d ms" % processing_time) except KeyboardInterrupt: - self._keyboard_interrupt() + self.keyboard_interrupt() return except: self.error("Failed processing files!")