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 c0df40f..eb70dc4 100644 Binary files a/locales/fr/LC_MESSAGES/base.mo and b/locales/fr/LC_MESSAGES/base.mo differ 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 : "