From e3ec7e3a330bcf2fe823c53758dda29ec3e3e420 Mon Sep 17 00:00:00 2001 From: surister Date: Mon, 19 Nov 2018 16:03:00 +0100 Subject: [PATCH 1/5] Add Pipfile to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 485dee6..10fdb05 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .idea +Pipfile +Pipfile.lock From 68f04d9381ece50ca68341acb71708b8d9eeb887 Mon Sep 17 00:00:00 2001 From: surister Date: Mon, 19 Nov 2018 16:04:45 +0100 Subject: [PATCH 2/5] Removed encoding declaration, it is not needed in python 3 as it comes by default. See PEP 3120 --- src/antergos-alerts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/antergos-alerts.py b/src/antergos-alerts.py index b6d0ca9..2ae9c22 100755 --- a/src/antergos-alerts.py +++ b/src/antergos-alerts.py @@ -1,5 +1,5 @@ #!/bin/python -# -*- coding: utf-8 -*- +# # # antergos-alerts.py # From b2d3936055e07831ac373d90bcd1ee0925c4e726 Mon Sep 17 00:00:00 2001 From: surister Date: Mon, 19 Nov 2018 16:05:15 +0100 Subject: [PATCH 3/5] Changed from ../python to ../env python --- src/antergos-alerts.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/antergos-alerts.py b/src/antergos-alerts.py index 2ae9c22..209e499 100755 --- a/src/antergos-alerts.py +++ b/src/antergos-alerts.py @@ -1,5 +1,4 @@ -#!/bin/python -# +#!/bin/env python # # antergos-alerts.py # From 94a4536606b3296d0a00effe5cebce142311233a Mon Sep 17 00:00:00 2001 From: surister Date: Mon, 19 Nov 2018 16:05:43 +0100 Subject: [PATCH 4/5] Deleted 'object' inheritance, this is not needed in python3 --- src/antergos-alerts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/antergos-alerts.py b/src/antergos-alerts.py index 209e499..18ddee7 100755 --- a/src/antergos-alerts.py +++ b/src/antergos-alerts.py @@ -31,7 +31,7 @@ from termcolor import colored, cprint -class AntergosAlerts(object): +class AntergosAlerts: """ Manages antergos alerts """ APP_NAME = 'ANTERGOS_NOTIFY' LOCALE_DIR = '/usr/share/locale' From 953cc8214fee92855de581ea6fe570e7667f7fe9 Mon Sep 17 00:00:00 2001 From: surister Date: Mon, 19 Nov 2018 16:06:22 +0100 Subject: [PATCH 5/5] Add missing function type hints --- src/antergos-alerts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/antergos-alerts.py b/src/antergos-alerts.py index 18ddee7..406cd32 100755 --- a/src/antergos-alerts.py +++ b/src/antergos-alerts.py @@ -70,7 +70,7 @@ def __init__(self): self.alert_ids = self.alerts.keys() - def run(self): + def run(self) -> None: """ Runs program """ self.setup_gettext() @@ -81,7 +81,7 @@ def run(self): self.save_completed_alerts() @staticmethod - def setup_gettext()-> None: + def setup_gettext() -> None: """ Initialize gettext for string translations """ try: gettext.textdomain(AntergosAlerts.APP_NAME) @@ -204,7 +204,7 @@ def do_alerts(self) -> None: self.completed_alert_ids.append(alert_id) - def save_completed_alerts(self): + def save_completed_alerts(self) -> None: """ Store already shown alerts """ try: with open(AntergosAlerts.COMPLETED_JSON, 'w') as json_data: