Skip to content

Commit

Permalink
fixes #6 - Can now tidy removed packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Jan 17, 2019
1 parent 140fea7 commit 6b49c81
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION ?= 0.3.2
VERSION ?= 0.3.3
CACHE ?= --no-cache=1
FULLVERSION ?= ${VERSION}
archs ?= s390x arm32v7 amd64 i386 arm64v8 arm32v6
Expand Down
2 changes: 1 addition & 1 deletion github_release_notifier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""

__all__ = ['parser', 'webhook', 'notifier']
__version__ = '0.3.2'
__version__ = '0.3.3'
22 changes: 14 additions & 8 deletions github_release_notifier/notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ def run(file: str = __DEFAULT_FILE__) -> dict:
logger = logging.getLogger(__name__)
updated = {}
for package in get_list():
for entry in parse(package):
if version_compare(entry['version'], get_version(package)) > 0:
database = _get_database(file)
database[package] = entry['version']
_set_database(database, file)
updated[package] = entry['version']
for webhook in get(package):
threading.Thread(target=_call_webhook, args=(webhook, entry, logger,)).start()
try:
for entry in parse(package):
if version_compare(entry['version'], get_version(package)) > 0:
database = _get_database(file)
database[package] = entry['version']
_set_database(database, file)
updated[package] = entry['version']
for webhook in get(package):
threading.Thread(target=_call_webhook, args=(webhook, entry, logger,)).start()
except NameError as e:
logger.error("Package removed : %s" % package)
database = _get_database(file)
del database[package]
_set_database(database, file)
return updated


Expand Down

0 comments on commit 6b49c81

Please sign in to comment.