Skip to content

Commit

Permalink
Merge pull request seb-m#102 from blueyed/sync-versions-for-python2-3
Browse files Browse the repository at this point in the history
Sync whitespace / comments between Python 2 and 3 versions
  • Loading branch information
seb-m committed Jun 4, 2015
2 parents 2d716e5 + 387e544 commit 0f3f895
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
18 changes: 9 additions & 9 deletions python2/pyinotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -1113,8 +1116,8 @@ def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
@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
Expand Down Expand Up @@ -1669,7 +1672,6 @@ def __repr__(self):
class ExcludeFilter:
"""
ExcludeFilter is an exclusion filter.
"""
def __init__(self, arg_lst):
"""
Expand Down Expand Up @@ -1734,7 +1736,6 @@ class WatchManagerError(Exception):
"""
WatchManager Exception. Raised on error encountered on watches
operations.
"""
def __init__(self, msg, wmd):
"""
Expand Down Expand Up @@ -1860,6 +1861,7 @@ def __add_watch(self, path, mask, proc_fun, auto_add, exclude_filter):
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
Expand Down Expand Up @@ -1915,10 +1917,9 @@ def add_watch(self, path, mask, proc_fun=None, rec=False,
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, ...}
Expand Down Expand Up @@ -2212,7 +2213,6 @@ def set_ignore_events(self, nval):
"Make watch manager ignoring new events.")



class RawOutputFormat:
"""
Format string representations.
Expand Down
11 changes: 7 additions & 4 deletions python3/pyinotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,10 +1280,13 @@ def process_events(self):
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/<sys.argv[0]|pyinotify>.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/<sys.argv[0]|pyinotify>.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/'
Expand Down

0 comments on commit 0f3f895

Please sign in to comment.