Rename private methods to be underscored

This commit is contained in:
R. Richard 2019-06-25 11:32:11 +02:00 committed by Kristóf Tóth
parent d8e2f8a92a
commit 5e06f72c35

View File

@ -74,10 +74,10 @@ class InotifyObserver:
self._reset(paths, patterns, exclude)
def _reset(self, paths, patterns, exclude):
dispatch_event = self.dispatch_event
_dispatch_event = self._dispatch_event
class TransformerEventHandler(PatternMatchingEventHandler):
def on_any_event(self, event):
dispatch_event(event)
_dispatch_event(event)
self.handler = TransformerEventHandler(patterns, exclude)
self._observer.unschedule_all()
if isinstance(paths, str):
@ -122,7 +122,7 @@ class InotifyObserver:
self._observer.stop()
self._observer.join()
def dispatch_event(self, event):
def _dispatch_event(self, event):
event_to_action = {
InotifyFileCreatedEvent : self.on_created,
InotifyFileModifiedEvent : self.on_modified,
@ -134,12 +134,12 @@ class InotifyObserver:
InotifyDirDeletedEvent : self.on_deleted
}
event = self.transform_event(event)
event = self._transform_event(event)
self.on_any_event(event)
event_to_action[type(event)](event)
@staticmethod
def transform_event(event):
def _transform_event(event):
watchdog_to_inotify = {
FileCreatedEvent : InotifyFileCreatedEvent,
FileModifiedEvent : InotifyFileModifiedEvent,