Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f02e1948b7
|
||
|
|
a32638860e
|
||
|
|
3afcddaeb6
|
||
|
|
05eb46a0bd
|
||
|
|
53eb8f48ed
|
||
|
|
5556902e54
|
@@ -95,8 +95,8 @@ If *action* is delete, delete non-empty directories if *rec* is set to True.
|
|||||||
```python
|
```python
|
||||||
move_rule = FileManagerRule(
|
move_rule = FileManagerRule(
|
||||||
action="move",
|
action="move",
|
||||||
src_re="^/src_path/(?P<path>.*).to_move$",
|
src_re=r"^/src_path/(?P<path>.*).to_move$",
|
||||||
dst_re="/dst_path/\g<path>",
|
dst_re=r"/dst_path/\g<path>",
|
||||||
auto_create=False,
|
auto_create=False,
|
||||||
rec=False,
|
rec=False,
|
||||||
filemode=None,
|
filemode=None,
|
||||||
@@ -107,7 +107,7 @@ move_rule = FileManagerRule(
|
|||||||
|
|
||||||
delete_rule = FileManagerRule(
|
delete_rule = FileManagerRule(
|
||||||
action="delete",
|
action="delete",
|
||||||
src_re="^/src_path/(?P<path>.*).to_delete$",
|
src_re=r"^/src_path/(?P<path>.*).to_delete$",
|
||||||
rec=False)
|
rec=False)
|
||||||
|
|
||||||
file_sched = FileManagerScheduler(
|
file_sched = FileManagerScheduler(
|
||||||
@@ -260,23 +260,23 @@ pyinotifyd.add_watch(
|
|||||||
```python
|
```python
|
||||||
move_rule = FileManagerRule(
|
move_rule = FileManagerRule(
|
||||||
action="move",
|
action="move",
|
||||||
src_re="^/src_path/(?P<path>.*)\.to_move$",
|
src_re=r"^/src_path/(?P<path>.*)\.to_move$",
|
||||||
dst_re="/dst_path/\g<path>",
|
dst_re=r"/dst_path/\g<path>",
|
||||||
auto_create=True,
|
auto_create=True,
|
||||||
filemode=0o644,
|
filemode=0o644,
|
||||||
dirmode=0o755)
|
dirmode=0o755)
|
||||||
|
|
||||||
copy_rule = FileManagerRule(
|
copy_rule = FileManagerRule(
|
||||||
action="copy",
|
action="copy",
|
||||||
src_re="^/src_path/(?P<path>.*)\.to_copy$",
|
src_re=r"^/src_path/(?P<path>.*)\.to_copy$",
|
||||||
dst_re="/dst_path/\g<path>",
|
dst_re=r"/dst_path/\g<path>",
|
||||||
auto_create=True,
|
auto_create=True,
|
||||||
filemode=0o644,
|
filemode=0o644,
|
||||||
dirmode=0o755)
|
dirmode=0o755)
|
||||||
|
|
||||||
delete_rule = FileManagerRule(
|
delete_rule = FileManagerRule(
|
||||||
action="delete",
|
action="delete",
|
||||||
src_re="^/src_path/(?P<path>.*)\.to_delete$",
|
src_re=r"^/src_path/(?P<path>.*)\.to_delete$",
|
||||||
rec=False)
|
rec=False)
|
||||||
|
|
||||||
file_sched = FileManagerScheduler(
|
file_sched = FileManagerScheduler(
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# Copyright 2020 Gentoo Authors
|
# Copyright 2020 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=7
|
EAPI=8
|
||||||
PYTHON_COMPAT=( python3_{8..11} )
|
PYTHON_COMPAT=( python3_{13..14} )
|
||||||
DISTUTILS_USE_SETUPTOOLS=rdepend
|
DISTUTILS_USE_PEP517=setuptools
|
||||||
|
|
||||||
SCM=""
|
SCM=""
|
||||||
if [ "${PV#9999}" != "${PV}" ] ; then
|
if [ "${PV#9999}" != "${PV}" ] ; then
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ from pyinotify import ProcessEvent, ExcludeFilter
|
|||||||
from pyinotifyd._install import install, uninstall
|
from pyinotifyd._install import install, uninstall
|
||||||
from pyinotifyd.scheduler import TaskScheduler, Cancel
|
from pyinotifyd.scheduler import TaskScheduler, Cancel
|
||||||
|
|
||||||
__version__ = "0.0.9"
|
__version__ = "1.0.2"
|
||||||
|
|
||||||
|
|
||||||
def setLoglevel(loglevel, logname=None):
|
def setLoglevel(loglevel, logname=None):
|
||||||
@@ -203,7 +203,9 @@ class Watch:
|
|||||||
do_glob=True)
|
do_glob=True)
|
||||||
|
|
||||||
self._notifier = pyinotify.AsyncioNotifier(
|
self._notifier = pyinotify.AsyncioNotifier(
|
||||||
self._watch_manager, asyncio.get_event_loop(), default_proc_fun=self._event_map)
|
self._watch_manager,
|
||||||
|
asyncio.get_event_loop(),
|
||||||
|
default_proc_fun=self._event_map)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self._notifier.stop()
|
self._notifier.stop()
|
||||||
@@ -456,7 +458,7 @@ def main():
|
|||||||
f"%(asctime)s - {name}/%(name)s - %(levelname)s - %(message)s")
|
f"%(asctime)s - {name}/%(name)s - %(levelname)s - %(message)s")
|
||||||
ch.setFormatter(formatter)
|
ch.setFormatter(formatter)
|
||||||
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
loop.add_signal_handler(
|
loop.add_signal_handler(
|
||||||
signal.SIGTERM, lambda: loop.create_task(
|
signal.SIGTERM, lambda: loop.create_task(
|
||||||
daemon.shutdown("SIGTERM")))
|
daemon.shutdown("SIGTERM")))
|
||||||
@@ -466,6 +468,7 @@ def main():
|
|||||||
loop.add_signal_handler(
|
loop.add_signal_handler(
|
||||||
signal.SIGHUP, lambda: loop.create_task(
|
signal.SIGHUP, lambda: loop.create_task(
|
||||||
daemon.reload("SIGHUP", args.config, args.debug)))
|
daemon.reload("SIGHUP", args.config, args.debug)))
|
||||||
|
asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
daemon.start()
|
daemon.start()
|
||||||
loop.run_forever()
|
loop.run_forever()
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
#move_rule = Rule(
|
#move_rule = Rule(
|
||||||
# action="move",
|
# action="move",
|
||||||
# src_re="^/src_path/(?P<path>.*).to_move",
|
# src_re=r"^/src_path/(?P<path>.*).to_move",
|
||||||
# dst_re="/dst_path/\g<path>.moved",
|
# dst_re=r"/dst_path/\g<path>.moved",
|
||||||
# auto_create=True,
|
# auto_create=True,
|
||||||
# filemode=0o755,
|
# filemode=0o755,
|
||||||
# dirmode=0o644,
|
# dirmode=0o644,
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
#delete_rule = Rule(
|
#delete_rule = Rule(
|
||||||
# action="delete",
|
# action="delete",
|
||||||
# src_re="^/src_path/(?P<path>.*).to_delete",
|
# src_re=r"^/src_path/(?P<path>.*).to_delete",
|
||||||
# rec=False)
|
# rec=False)
|
||||||
|
|
||||||
#file_sched = FileManagerScheduler(
|
#file_sched = FileManagerScheduler(
|
||||||
|
|||||||
Reference in New Issue
Block a user