Skip to content

Commit

Permalink
[RELEASE] Version: 0.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Delle Cave committed Nov 17, 2019
1 parent bd9f1a2 commit 8fa3988
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 16 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
python-dwho (0.3.6) unstable; urgency=medium

* [RELEASE] Version: 0.3.6

-- Adrien DELLE CAVE (Decryptus) <adc@doowan.net> Mon, 18 Nov 2019 00:08:25 +0100

python-dwho (0.3.5) unstable; urgency=medium

* Added method load_exclude_patterns.

-- Adrien DELLE CAVE (Decryptus) <adc@doowan.net> Mon, 18 Nov 2019 00:05:39 +0100

python-dwho (0.3.4) unstable; urgency=medium

* Added method get_event_params.
Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.4
0.3.6
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.4
0.3.6
36 changes: 24 additions & 12 deletions dwho/classes/inotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,29 @@ def __init__(self,


class DWhoInotifyConfig(object): # pylint: disable=useless-object-inheritance
@staticmethod
def load_exclude_patterns(exclude_files):
r = set()

if isinstance(exclude_files, six.string_types):
exclude_files = [exclude_files]
elif not isinstance(exclude_files, list):
LOG.error("invalid exclude_files type. (exclude_files: %r)",
exclude_files)
exclude_files = []

for x in exclude_files:
pattern = helpers.load_patterns_from_file(x)
if not pattern:
raise DWhoConfigurationError("unable to load exclude patterns from %r." % x)

r.update(pattern)

if r:
return pyinotify.ExcludeFilter(list(r))

return None

def __call__(self, notifier, conf):
if 'plugins' not in conf:
conf['plugins'] = DEFAULT_CONFIG['plugins'].copy()
Expand Down Expand Up @@ -131,19 +154,8 @@ def __call__(self, notifier, conf):
if exclude_file in value['exclude_files']:
value['exclude_files'].remove(exclude_file)

value['exclude_patterns'] = set()

if value['exclude_files']:
for x in value['exclude_files']:
pattern = helpers.load_patterns_from_file(x)
if not pattern:
raise DWhoConfigurationError("Unable to load exclude patterns from %r. (path: %r)"
% (x, path))

value['exclude_patterns'].update(pattern)

if value['exclude_patterns']:
value['exclude_patterns'] = pyinotify.ExcludeFilter(list(value['exclude_patterns']))
value['exclude_patterns'] = self.load_exclude_patterns(value['exclude_files'])
else:
value['exclude_patterns'] = None

Expand Down
4 changes: 2 additions & 2 deletions setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: dwho
author: Adrien Delle Cave
author_email: pypi@doowan.net
copyright: '2019 Adrien Delle Cave'
release: '0.3.4'
version: '0.3.4'
release: '0.3.6'
version: '0.3.6'
license: License GPL-3
url: https://github.com/decryptus/dwho
python_requires:
Expand Down

0 comments on commit 8fa3988

Please sign in to comment.