From 8e5fb7e6a1fe5e263f2430614928cc29ed42d0c0 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Mon, 18 Sep 2017 12:06:32 -0400 Subject: [PATCH 1/3] fixed error when slug has trailing slash --- locale/es/LC_MESSAGES/messages.po | 79 +++++++++++++++++-------------- setup.py | 2 +- submit50.py | 4 ++ tmp/hello.c | 0 4 files changed, 48 insertions(+), 37 deletions(-) delete mode 100644 tmp/hello.c diff --git a/locale/es/LC_MESSAGES/messages.po b/locale/es/LC_MESSAGES/messages.po index 6166e77..17feb21 100644 --- a/locale/es/LC_MESSAGES/messages.po +++ b/locale/es/LC_MESSAGES/messages.po @@ -8,96 +8,103 @@ msgid "You have an old version of python. Install version 2.7 or higher." msgstr "" "Tienes una versión antigua de python. Instala la versión 2.7 o superior." -#: submit50.py:116 +#: submit50.py:119 msgid "show commands being executed" msgstr "mostrar comandos que se están ejecutando" -#: submit50.py:117 +#: submit50.py:120 msgid "prescribed identifier of work to submit" msgstr "identificador prescrito del trabajo para entregar" -#: submit50.py:177 +#: submit50.py:182 msgid "GitHub username: " msgstr "Nombre de usuario de GitHub: " -#: submit50.py:185 +#: submit50.py:190 msgid "GitHub password: " msgstr "Contraseña de GitHub: " -#: submit50.py:225 +#: submit50.py:230 msgid "Invalid username and/or password." msgstr "Nombre de usuario y/o contraseña es inválido." -#: submit50.py:229 +#: submit50.py:234 msgid "Could not authenticate user." msgstr "No se pudo autenticar usuario." -#: submit50.py:282 +#: submit50.py:288 msgid "Could not connect to GitHub." msgstr "No se pudo conectar a GitHub." -#: submit50.py:286 +#: submit50.py:292 msgid "Sorry, something's wrong! Let sysadmins@cs50.harvard.edu know!" msgstr "¡Lo siento, algo está mal! ¡Déjale saber a sysadmins@cs50.harvard.edu!" -#: submit50.py:292 submit50.py:309 +#: submit50.py:298 submit50.py:316 msgid "Submission cancelled." msgstr "La entrega se canceló." -#: submit50.py:409 +#: submit50.py:422 msgid "You don't have git. Install git, then re-run {}!" msgstr "No tienes git. ¡Instala git, y luego vuelve a ejecutar {}!" -#: submit50.py:413 +#: submit50.py:427 msgid "" "You have an old version of git. Install version 2.7 or later, then re-run {}!" msgstr "" "Tienes una versión antigua de git. ¡Instala la versión 2.7 o superior, y " "vuelve a ejecutar {}!" -#: submit50.py:427 +#: submit50.py:441 msgid "" "You have an unknown version of submit50. Email sysadmins@cs50.harvard.edu!" msgstr "" "Tienes una versión desconocida de submit50. ¡Escríbele a sysadmins@cs50." "harvard.edu!" -#: submit50.py:431 +#: submit50.py:445 msgid "You have an old version of submit50. Run update50, then re-run {}!" msgstr "" "Tienes una versión antigua de submit50. ¡Ejecuta update50, y luego vuelve a " "ejecutar {}!" -#: submit50.py:451 +#: submit50.py:465 msgid "Invalid slug. Did you mean to submit something else?" msgstr "El slug no es válido. ¿Quisiste entregar algo más?" -#: submit50.py:467 +#: submit50.py:469 +msgid "Invalid slug. Did you mean {}, without the slashes?" +msgstr "El slug no es válido. ¿Quisiste {}, sin las barras?" + +#: submit50.py:471 +msgid "Invalid slug. Did you mean {}, without the slash?" +msgstr "El slug no es válido. ¿Quisiste {}, sin la barra?" + +#: submit50.py:485 msgid "You seem to be missing these files:" msgstr "Parece que faltan estos archivos:" -#: submit50.py:470 +#: submit50.py:488 msgid "Ensure you have the required files before submitting." msgstr "Asegúrate de tener los archivos necesarios antes de entregar." -#: submit50.py:473 +#: submit50.py:491 msgid "Authenticating" msgstr "Autenticando" -#: submit50.py:499 +#: submit50.py:518 msgid "Preparing" msgstr "Preparando" -#: submit50.py:506 +#: submit50.py:526 msgid "" -"Looks like {} isn't enabled for your account yet. Log into https://cs50.me/ " -"in a browser, click \"Authorize application\", and re-run {} here!" +"Looks like {} isn't enabled for your account yet. Go to https://cs50.me/" +"authorize and make sure you accept any pending invitations!" msgstr "" -"Parece que {} todavía no está habilitado para tu cuenta. ¡Inicie sesión en " -"https://cs50.me/ en un navegador, haga clic en \"Authorize application\", y " -"vuelve a ejecutar {} aquí!" +"Parece que {} todavia no esta habilitado en tu cuenta. Visita https://cs50.me/" +"authorize y asegúrate de aceptar las invitaciones pendientes!" -#: submit50.py:509 +#: submit50.py:529 msgid "" "Looks like you have the wrong username in ~/.gitconfig or {} isn't yet " "enabled for your account. Double-check ~/.gitconfig and then log into " @@ -109,7 +116,7 @@ msgstr "" "ingresa en https://cs50.me/ en un navegador, haga clic en \"Authorize " "application\" si se te solicita, y vuelve a ejecutar {} aquí." -#: submit50.py:557 +#: submit50.py:577 msgid "" "These files are too large to be submitted:\n" "{}\n" @@ -119,7 +126,7 @@ msgstr "" "{}\n" "¡Quita estos archivos de tu directorio y luego vuelve a ejecutar: {}!" -#: submit50.py:562 +#: submit50.py:582 msgid "" "These files are too large to be submitted:\n" "{}\n" @@ -131,19 +138,19 @@ msgstr "" "Instala git-lfs (o quita estos archivos de tu directorio) y luego vuelve a " "ejecutar {}!" -#: submit50.py:573 +#: submit50.py:593 msgid "No files in this directory are expected for submission." msgstr "Ningún archivo en este directorio se espera para la entrega." -#: submit50.py:578 +#: submit50.py:598 msgid "Files that will be submitted:" msgstr "Archivos que se van a entregar:" -#: submit50.py:584 +#: submit50.py:604 msgid "Files that won't be submitted:" msgstr "Archivos que no se van a entregar:" -#: submit50.py:590 +#: submit50.py:610 msgid "" "Keeping in mind the course's policy on academic honesty, are you sure you " "want to submit these files (yes/no)? " @@ -151,22 +158,22 @@ msgstr "" "Teniendo en cuenta la política de honestidad académica del curso, ¿estás " "seguro que quieres enviar estos archivos (yes/no)? " -#: submit50.py:596 +#: submit50.py:616 msgid "No files were submitted." msgstr "No se ha entregado ningún archivo." -#: submit50.py:600 +#: submit50.py:620 msgid "Submitting" msgstr "Entregando" -#: submit50.py:602 +#: submit50.py:622 msgid "Uploading" msgstr "Subiendo" -#: submit50.py:611 +#: submit50.py:631 msgid "Submitted {}! See https://cs50.me/submissions." msgstr "¡Se entregó {}! Puedes ver https://cs50.me/submissions." -#: submit50.py:660 +#: submit50.py:680 msgid "Could not complete two-factor authentication." msgstr "No se pudo completar la autenticación de dos factores." diff --git a/setup.py b/setup.py index e347746..5d8bb80 100644 --- a/setup.py +++ b/setup.py @@ -62,5 +62,5 @@ class CustomInstall(install): "console_scripts": ["submit50=submit50:main"] }, url="https://github.com/cs50/submit50", - version="2.4.3" + version="2.4.4" ) diff --git a/submit50.py b/submit50.py index efe9fe2..1d19688 100755 --- a/submit50.py +++ b/submit50.py @@ -465,6 +465,10 @@ def submit(org, branch): e = Error(_("Invalid slug. Did you mean to submit something else?")) e.__cause__ = None raise e + if slug.startswith("/") and slug.endswith("/"): + raise Error(_("Invalid slug. Did you mean {}, without the slashes?".format(slug.strip("/")))) + elif slug.startswith("/") or slug.endswith("/"): + raise Error(_("Invalid slug. Did you mean {}, without the slash?".format(slug.strip("/")))) # check for missing files missing = [] diff --git a/tmp/hello.c b/tmp/hello.c deleted file mode 100644 index e69de29..0000000 From bd8733aa31b3f14d121027b5fe4d316c58c96c07 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Mon, 18 Sep 2017 12:18:28 -0400 Subject: [PATCH 2/3] tweaked wording --- locale/es/LC_MESSAGES/messages.po | 54 ++++++++++++++++++------------- submit50.py | 8 +++-- tmp/hello.c | 0 3 files changed, 36 insertions(+), 26 deletions(-) create mode 100644 tmp/hello.c diff --git a/locale/es/LC_MESSAGES/messages.po b/locale/es/LC_MESSAGES/messages.po index 17feb21..d78e5ba 100644 --- a/locale/es/LC_MESSAGES/messages.po +++ b/locale/es/LC_MESSAGES/messages.po @@ -1,5 +1,7 @@ msgid "" msgstr "" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-18 16:09+0000\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -73,38 +75,44 @@ msgid "Invalid slug. Did you mean to submit something else?" msgstr "El slug no es válido. ¿Quisiste entregar algo más?" #: submit50.py:469 -msgid "Invalid slug. Did you mean {}, without the slashes?" -msgstr "El slug no es válido. ¿Quisiste {}, sin las barras?" +msgid "" +"Invalid slug. Did you mean {}, without the leading and trailing slashes?" +msgstr "El slug no es válido. ¿Querías decir {}, sin las barras la barra " +"diagonal principal y la barra diagonal final?" #: submit50.py:471 -msgid "Invalid slug. Did you mean {}, without the slash?" -msgstr "El slug no es válido. ¿Quisiste {}, sin la barra?" +msgid "Invalid slug. Did you mean {}, without the leading slash?" +msgstr "El slug no es válido. ¿Querías decir {}, sin la barra diagonal principal?" + +#: submit50.py:473 +msgid "Invalid slug. Did you mean {}, without the trailing slash?" +msgstr "El slug no es válido. ¿Querías decir {}, sin la barra diagonal al final?" -#: submit50.py:485 +#: submit50.py:487 msgid "You seem to be missing these files:" msgstr "Parece que faltan estos archivos:" -#: submit50.py:488 +#: submit50.py:490 msgid "Ensure you have the required files before submitting." msgstr "Asegúrate de tener los archivos necesarios antes de entregar." -#: submit50.py:491 +#: submit50.py:493 msgid "Authenticating" msgstr "Autenticando" -#: submit50.py:518 +#: submit50.py:520 msgid "Preparing" msgstr "Preparando" -#: submit50.py:526 +#: submit50.py:528 msgid "" "Looks like {} isn't enabled for your account yet. Go to https://cs50.me/" "authorize and make sure you accept any pending invitations!" msgstr "" -"Parece que {} todavia no esta habilitado en tu cuenta. Visita https://cs50.me/" -"authorize y asegúrate de aceptar las invitaciones pendientes!" +"Parece que {} todavia no esta habilitado en tu cuenta. Visita https://cs50." +"me/authorize y asegúrate de aceptar las invitaciones pendientes!" -#: submit50.py:529 +#: submit50.py:531 msgid "" "Looks like you have the wrong username in ~/.gitconfig or {} isn't yet " "enabled for your account. Double-check ~/.gitconfig and then log into " @@ -116,7 +124,7 @@ msgstr "" "ingresa en https://cs50.me/ en un navegador, haga clic en \"Authorize " "application\" si se te solicita, y vuelve a ejecutar {} aquí." -#: submit50.py:577 +#: submit50.py:579 msgid "" "These files are too large to be submitted:\n" "{}\n" @@ -126,7 +134,7 @@ msgstr "" "{}\n" "¡Quita estos archivos de tu directorio y luego vuelve a ejecutar: {}!" -#: submit50.py:582 +#: submit50.py:584 msgid "" "These files are too large to be submitted:\n" "{}\n" @@ -138,19 +146,19 @@ msgstr "" "Instala git-lfs (o quita estos archivos de tu directorio) y luego vuelve a " "ejecutar {}!" -#: submit50.py:593 +#: submit50.py:595 msgid "No files in this directory are expected for submission." msgstr "Ningún archivo en este directorio se espera para la entrega." -#: submit50.py:598 +#: submit50.py:600 msgid "Files that will be submitted:" msgstr "Archivos que se van a entregar:" -#: submit50.py:604 +#: submit50.py:606 msgid "Files that won't be submitted:" msgstr "Archivos que no se van a entregar:" -#: submit50.py:610 +#: submit50.py:612 msgid "" "Keeping in mind the course's policy on academic honesty, are you sure you " "want to submit these files (yes/no)? " @@ -158,22 +166,22 @@ msgstr "" "Teniendo en cuenta la política de honestidad académica del curso, ¿estás " "seguro que quieres enviar estos archivos (yes/no)? " -#: submit50.py:616 +#: submit50.py:618 msgid "No files were submitted." msgstr "No se ha entregado ningún archivo." -#: submit50.py:620 +#: submit50.py:622 msgid "Submitting" msgstr "Entregando" -#: submit50.py:622 +#: submit50.py:624 msgid "Uploading" msgstr "Subiendo" -#: submit50.py:631 +#: submit50.py:633 msgid "Submitted {}! See https://cs50.me/submissions." msgstr "¡Se entregó {}! Puedes ver https://cs50.me/submissions." -#: submit50.py:680 +#: submit50.py:682 msgid "Could not complete two-factor authentication." msgstr "No se pudo completar la autenticación de dos factores." diff --git a/submit50.py b/submit50.py index 1d19688..3ce48e6 100755 --- a/submit50.py +++ b/submit50.py @@ -466,9 +466,11 @@ def submit(org, branch): e.__cause__ = None raise e if slug.startswith("/") and slug.endswith("/"): - raise Error(_("Invalid slug. Did you mean {}, without the slashes?".format(slug.strip("/")))) - elif slug.startswith("/") or slug.endswith("/"): - raise Error(_("Invalid slug. Did you mean {}, without the slash?".format(slug.strip("/")))) + raise Error(_("Invalid slug. Did you mean {}, without the leading and trailing slashes?".format(slug.strip("/")))) + elif slug.startswith("/"): + raise Error(_("Invalid slug. Did you mean {}, without the leading slash?".format(slug.strip("/")))) + elif slug.endswith("/"): + raise Error(_("Invalid slug. Did you mean {}, without the trailing slash?".format(slug.strip("/")))) # check for missing files missing = [] diff --git a/tmp/hello.c b/tmp/hello.c new file mode 100644 index 0000000..e69de29 From 497c3b20c5d9d4f31e69889a9549771d44b61d49 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Mon, 18 Sep 2017 12:19:32 -0400 Subject: [PATCH 3/3] removed tmp --- tmp/hello.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tmp/hello.c diff --git a/tmp/hello.c b/tmp/hello.c deleted file mode 100644 index e69de29..0000000