From 387e5445468b88f6c97c7af66da5da2833caf34e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 16 Mar 2015 21:58:39 +0100 Subject: Sync whitespace / comments between Python 2 and 3 versions --- python2/pyinotify.py | 18 +++++++++--------- python3/pyinotify.py | 11 +++++++---- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/python2/pyinotify.py b/python2/pyinotify.py index 3ccc4c1..d2f0816 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -122,6 +122,9 @@ class INotifyWrapper: """ @staticmethod def create(): + """ + Factory method instanciating and returning the right wrapper. + """ # First, try to use ctypes. if ctypes: inotify = _CtypesLibcINotifyWrapper() @@ -1113,8 +1116,8 @@ class Notifier: @type default_proc_fun: instance of ProcessEvent @param read_freq: if read_freq == 0, events are read asap, if read_freq is > 0, this thread sleeps - max(0, read_freq - (timeout / 1000)) seconds. But - if timeout is None it may be different because + max(0, read_freq - (timeout / 1000)) seconds. But if + timeout is None it may be different because poll is blocking waiting for something to read. @type read_freq: int @param threshold: File descriptor will be read only if the accumulated @@ -1669,7 +1672,6 @@ class Watch: class ExcludeFilter: """ ExcludeFilter is an exclusion filter. - """ def __init__(self, arg_lst): """ @@ -1734,7 +1736,6 @@ class WatchManagerError(Exception): """ WatchManager Exception. Raised on error encountered on watches operations. - """ def __init__(self, msg, wmd): """ @@ -1860,6 +1861,7 @@ class WatchManager: return wd watch = Watch(wd=wd, path=path, mask=mask, proc_fun=proc_fun, auto_add=auto_add, exclude_filter=exclude_filter) + # wd are _always_ indexed with their original unicode paths in wmd. self._wmd[wd] = watch log.debug('New %s', watch) return wd @@ -1915,10 +1917,9 @@ class WatchManager: the class' constructor. @type exclude_filter: callable object @return: dict of paths associated to watch descriptors. A wd value - is positive if the watch was added sucessfully, - otherwise the value is negative. If the path was invalid - or was already watched it is not included into this returned - dictionary. + is positive if the watch was added sucessfully, otherwise + the value is negative. If the path was invalid or was already + watched it is not included into this returned dictionary. @rtype: dict of {str: int} """ ret_ = {} # return {path: wd, ...} @@ -2212,7 +2213,6 @@ class WatchManager: "Make watch manager ignoring new events.") - class RawOutputFormat: """ Format string representations. diff --git a/python3/pyinotify.py b/python3/pyinotify.py index 4eb03b0..bc24313 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -1280,10 +1280,13 @@ class Notifier: def __daemonize(self, pid_file=None, stdin=os.devnull, stdout=os.devnull, stderr=os.devnull): """ - pid_file: file where the pid will be written. If pid_file=None the pid - is written to /var/run/.pid, if - pid_file=False no pid_file is written. - stdin, stdout, stderr: files associated to common streams. + @param pid_file: file where the pid will be written. If pid_file=None + the pid is written to + /var/run/.pid, if pid_file=False + no pid_file is written. + @param stdin: + @param stdout: + @param stderr: files associated to common streams. """ if pid_file is None: dirname = '/var/run/' -- cgit v1.2.1