accepting comand line arguments

This commit is contained in:
Vinicius Moreira
2019-07-01 16:37:00 -03:00
parent a1e83a5d19
commit 060acaea08
9 changed files with 56 additions and 19 deletions

View File

@@ -53,7 +53,10 @@ class FlatpakManager:
api_data = self._request_app_data(app['id'])
if api_data:
api_data['expires_at'] = datetime.utcnow() + timedelta(seconds=self.cache_expire)
if self.cache_expire > 0:
api_data['expires_at'] = datetime.utcnow() + timedelta(seconds=self.cache_expire)
self.cache_apps[app['id']] = api_data
if not api_data:

View File

@@ -15,5 +15,4 @@ def stream_cmd(cmd: List[str]):
def notify_user(msg: str, icon_path: str = resource.get_path('img/logo.svg')):
if bool(os.getenv('FPAKMAN_UPDATE_NOTIFICATION', 1)):
os.system("notify-send {} '{}'".format("-i {}".format(icon_path) if icon_path else '', msg))
os.system("notify-send {} '{}'".format("-i {}".format(icon_path) if icon_path else '', msg))

View File

@@ -14,7 +14,7 @@ def get_locale_keys(key: str = None):
if key is None:
current_locale = locale.getdefaultlocale()
else:
current_locale = [key]
current_locale = [key.strip().lower()]
if current_locale:
current_locale = current_locale[0]