From 537a905f854de5a6b92c75b947d15b2e289642df Mon Sep 17 00:00:00 2001 From: Romain J Date: Tue, 10 Sep 2019 23:44:44 +0200 Subject: [PATCH] better with add . --- launcher.py | 17 ++++++++++++----- locales/en/LC_MESSAGES/base.po | 24 ++++++++++++++++++++++++ locales/fr/LC_MESSAGES/base.mo | Bin 980 -> 1335 bytes locales/fr/LC_MESSAGES/base.po | 24 ++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 5 deletions(-) diff --git a/launcher.py b/launcher.py index b1278b4..6650593 100644 --- a/launcher.py +++ b/launcher.py @@ -48,6 +48,8 @@ def run_bot(unload: list = []): loop = asyncio.get_event_loop() log = logging.getLogger() + print(gettext('Stating...')) + try: pool = loop.run_until_complete( Table.create_pool(config.postgresql, command_timeout=60) @@ -85,13 +87,18 @@ def _update(): if current != last: print(gettext('A new version is available !')) - check = input(gettext('Update ? [Y/n]')).lower().strip() + check = None - while check not in ['', 'y', 'n']: - check = input(gettext('Update ? [Y/n]')) + while check not in ['', 'y', 'n', 'o']: + check = input(gettext('Update ? [Y/n] ')).lower().strip() + print(check) + + if check in ['y', '', 'o']: + print(gettext('Downloading...')) + + origin = git.Repo(search_parent_directories=True).remotes['origin'] + origin.pull() - if check == 'y': - local.remotes.origin.pull() with setup_logging(): run_bot() else: diff --git a/locales/en/LC_MESSAGES/base.po b/locales/en/LC_MESSAGES/base.po index df3cf00..a1eff28 100644 --- a/locales/en/LC_MESSAGES/base.po +++ b/locales/en/LC_MESSAGES/base.po @@ -15,6 +15,10 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" +#: launcher.py:51 +msgid "Stating..." +msgstr "" + #: launcher.py:56 launcher.py:57 msgid "Could not set up PostgreSQL..." msgstr "" @@ -27,6 +31,26 @@ msgstr "" msgid "Search for update" msgstr "" +#: launcher.py:73 +msgid "Checking for update..." +msgstr "" + +#: launcher.py:89 +msgid "A new version is available !" +msgstr "" + +#: launcher.py:93 +msgid "Update ? [Y/n] " +msgstr "" + +#: launcher.py:97 +msgid "Downloading..." +msgstr "" + +#: launcher.py:108 +msgid "Tuxbot is up to date" +msgstr "" + #: bot.py:52 msgid "Failed to load extension : " msgstr "" diff --git a/locales/fr/LC_MESSAGES/base.mo b/locales/fr/LC_MESSAGES/base.mo index c0df40f4f79b59fcafdb4cc9083d0c29373a3c23..eb70dc4735fbb26e44540961a6d86a1ab0db3eac 100644 GIT binary patch delta 554 zcmYk%O)mpM7zglay#+k1e8zZu4hkrX)y; z11byGvy~*P)Hw=_sDX%j)BK`?}^D zTgwV|L$k3B|1hnz8RnNrD>8j7_1#YMw7oSgcj)FMG#^?@NkLNiW#Qny-w?vnl(oH* zlG6Uku_iJF;bKu%P|@}T)h}pI`7Y7~FX32pqh53BwM>D#c~KNn2cO}qNU~lla@XZ~ bgbq%d7UGRuW`3ietq85%zi}qrD$=npgzcBU{C?lUw||#1A{JuB+xXFfIN@}8RP<_ yK@RZ-(z-x814!Ef>1jZEvIC>SWY#F;0HLtUOtsWzppGEOr2aE*QQ5 diff --git a/locales/fr/LC_MESSAGES/base.po b/locales/fr/LC_MESSAGES/base.po index 4b3581f..c74d468 100644 --- a/locales/fr/LC_MESSAGES/base.po +++ b/locales/fr/LC_MESSAGES/base.po @@ -15,6 +15,10 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" +#: launcher.py:51 +msgid "Stating..." +msgstr "Démarrage..." + #: launcher.py:56 launcher.py:57 msgid "Could not set up PostgreSQL..." msgstr "Impossible de lancer PostgreSQL..." @@ -27,6 +31,26 @@ msgstr "Lancer sans charger le module " msgid "Search for update" msgstr "Rechercher les mises à jour" +#: launcher.py:73 +msgid "Checking for update..." +msgstr "Recherche de mise à jour..." + +#: launcher.py:89 +msgid "A new version is available !" +msgstr "Une nouvelle version est disponnible !" + +#: launcher.py:93 +msgid "Update ? [Y/n] " +msgstr "Mettre à jour ? [O/n]" + +#: launcher.py:97 +msgid "Downloading..." +msgstr "Téléchargement..." + +#: launcher.py:108 +msgid "Tuxbot is up to date" +msgstr "Tuxbot est à jour" + #: bot.py:52 msgid "Failed to load extension : " msgstr "Impossible de charger l'extension : "