Skip to content

Commit

Permalink
keyboard_interrupt method is now public; prepared for release
Browse files Browse the repository at this point in the history
  • Loading branch information
fracpete committed Dec 10, 2020
1 parent d98d9d6 commit 05c160c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

0.0.7 (2020-12-10)
------------------

- `keyboard_interrupt` method is now public


0.0.6 (2020-12-10)
------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
)
10 changes: 5 additions & 5 deletions src/sfp/_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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())
Expand All @@ -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!")
Expand Down Expand Up @@ -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)
Expand All @@ -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!")
Expand Down

0 comments on commit 05c160c

Please # to comment.