From c1b4cb7daf0320cf7d49c42d65aac76ee549b57b Mon Sep 17 00:00:00 2001 From: jelleas Date: Mon, 9 Sep 2019 11:48:16 +0200 Subject: [PATCH 01/11] rm no windows support --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index c96431c..3b74680 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,3 @@ -if __import__("os").name == "nt": - raise RuntimeError("submit50 does not support Windows directly. Instead, you should install the Windows Subsystem for Linux (https://docs.microsoft.com/en-us/windows/wsl/install-win10) and then install submit50 within that.") - from setuptools import setup setup( author="CS50", @@ -25,6 +22,6 @@ entry_points={ "console_scripts": ["submit50=submit50.__main__:main"] }, - version="3.0.2", + version="3.0.3", include_package_data=True ) From 70002d6825fec3a0e4428b71999a64a4b20d6e5b Mon Sep 17 00:00:00 2001 From: jelleas Date: Mon, 9 Sep 2019 11:52:03 +0200 Subject: [PATCH 02/11] lib50 2.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3b74680..0b17fac 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ 'submit50': [('**.py', 'python', None),], }, description="This is submit50, with which you can submit solutions to problems for CS50.", - install_requires=["lib50>=2,<3", "requests>=2.19", "termcolor>=1.1"], + install_requires=["lib50>=2.1,<3", "requests>=2.19", "termcolor>=1.1"], keywords=["submit", "submit50"], name="submit50", python_requires=">=3.6", From bf73fdcd706e1f767c6cbb055f2f98ebaaaa74de Mon Sep 17 00:00:00 2001 From: ashermkn1 Date: Wed, 8 Apr 2020 17:07:18 -0400 Subject: [PATCH 03/11] add honesty prompt support Add extra argument to prompt, ```question```, where the user can specify a custom honesty prompt if desired or a false-y value if the user does not want any honesty prompt. --- submit50/__main__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/submit50/__main__.py b/submit50/__main__.py index ea8468e..50c4807 100644 --- a/submit50/__main__.py +++ b/submit50/__main__.py @@ -63,7 +63,8 @@ def cprint(text="", color=None, on_color=None, attrs=None, **kwargs): color=color, on_color=on_color, attrs=attrs, **kwargs) -def prompt(included, excluded): +def prompt(question = "Keeping in mind the course's policy on academic honesty, " + "are you sure you want to submit these files (yes/no)? ", included, excluded): if included: cprint(_("Files that will be submitted:"), "green") for file in included: @@ -79,9 +80,10 @@ def prompt(included, excluded): # Prompt for honesty readline.clear_history() + if not honesty: + return True try: - answer = input(_("Keeping in mind the course's policy on academic honesty, " - "are you sure you want to submit these files (yes/no)? ")) + answer = input(_(question)) except EOFError: answer = None print() From 1dc5c47a4634bde16aeacfdf83759aa29a76c961 Mon Sep 17 00:00:00 2001 From: ashermkn1 Date: Wed, 8 Apr 2020 17:18:42 -0400 Subject: [PATCH 04/11] update version to be compatible with lib50 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0b17fac..33158cc 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ 'submit50': [('**.py', 'python', None),], }, description="This is submit50, with which you can submit solutions to problems for CS50.", - install_requires=["lib50>=2.1,<3", "requests>=2.19", "termcolor>=1.1"], + install_requires=["lib50>=3,<4", "requests>=2.19", "termcolor>=1.1"], keywords=["submit", "submit50"], name="submit50", python_requires=">=3.6", From c46952d55219ff709f1352994c977e43c00e2692 Mon Sep 17 00:00:00 2001 From: Asher Kornfeld Date: Thu, 9 Apr 2020 21:06:43 -0400 Subject: [PATCH 05/11] move no question condition --- submit50/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/submit50/__main__.py b/submit50/__main__.py index 50c4807..629900a 100644 --- a/submit50/__main__.py +++ b/submit50/__main__.py @@ -63,8 +63,7 @@ def cprint(text="", color=None, on_color=None, attrs=None, **kwargs): color=color, on_color=on_color, attrs=attrs, **kwargs) -def prompt(question = "Keeping in mind the course's policy on academic honesty, " - "are you sure you want to submit these files (yes/no)? ", included, excluded): +def prompt(question, included, excluded): if included: cprint(_("Files that will be submitted:"), "green") for file in included: @@ -79,9 +78,10 @@ def prompt(question = "Keeping in mind the course's policy on academic honesty, cprint("./{}".format(other), "yellow") # Prompt for honesty - readline.clear_history() if not honesty: return True + + readline.clear_history() try: answer = input(_(question)) except EOFError: From 3dbbbb4faa31264757dd231fe1c6af9317193fb6 Mon Sep 17 00:00:00 2001 From: Chad Sharp Date: Sat, 11 Apr 2020 14:35:30 -0400 Subject: [PATCH 06/11] Add (yes/no) to question --- submit50/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submit50/__main__.py b/submit50/__main__.py index 629900a..4c6f8c0 100644 --- a/submit50/__main__.py +++ b/submit50/__main__.py @@ -83,7 +83,7 @@ def prompt(question, included, excluded): readline.clear_history() try: - answer = input(_(question)) + answer = input(_(question + "(yes/no) ")) except EOFError: answer = None print() From 978c1b230caa76f84adf0321981deb53f003403c Mon Sep 17 00:00:00 2001 From: Chad Sharp Date: Sat, 11 Apr 2020 14:36:01 -0400 Subject: [PATCH 07/11] add space --- submit50/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submit50/__main__.py b/submit50/__main__.py index 4c6f8c0..2a3f968 100644 --- a/submit50/__main__.py +++ b/submit50/__main__.py @@ -83,7 +83,7 @@ def prompt(question, included, excluded): readline.clear_history() try: - answer = input(_(question + "(yes/no) ")) + answer = input(_(question + " (yes/no) ")) except EOFError: answer = None print() From 538a05cc0ea0aa915e42bd8edf04f9ecbbdd4946 Mon Sep 17 00:00:00 2001 From: Chad Sharp Date: Sat, 11 Apr 2020 14:40:42 -0400 Subject: [PATCH 08/11] separate strings for translation purposes --- submit50/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/submit50/__main__.py b/submit50/__main__.py index 2a3f968..d8abd78 100644 --- a/submit50/__main__.py +++ b/submit50/__main__.py @@ -82,8 +82,9 @@ def prompt(question, included, excluded): return True readline.clear_history() + try: - answer = input(_(question + " (yes/no) ")) + answer = input(f"{_(question)} ({_('yes/no')}) ") except EOFError: answer = None print() From b42b7f693ffdeddd140df0f0fcac1668e75cad12 Mon Sep 17 00:00:00 2001 From: jelleas Date: Tue, 28 Apr 2020 16:45:11 +0200 Subject: [PATCH 09/11] question => honesty --- submit50/__main__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/submit50/__main__.py b/submit50/__main__.py index d8abd78..824daea 100644 --- a/submit50/__main__.py +++ b/submit50/__main__.py @@ -63,7 +63,7 @@ def cprint(text="", color=None, on_color=None, attrs=None, **kwargs): color=color, on_color=on_color, attrs=attrs, **kwargs) -def prompt(question, included, excluded): +def prompt(honesty, included, excluded): if included: cprint(_("Files that will be submitted:"), "green") for file in included: @@ -80,11 +80,11 @@ def prompt(question, included, excluded): # Prompt for honesty if not honesty: return True - + readline.clear_history() - + try: - answer = input(f"{_(question)} ({_('yes/no')}) ") + answer = input(f"{_(honesty)} ({_('yes/no')}) ") except EOFError: answer = None print() From 3cbbba375cf502a17b9b4ce225c12ba2f90d3088 Mon Sep 17 00:00:00 2001 From: Chad Sharp Date: Wed, 29 Apr 2020 14:40:38 -0400 Subject: [PATCH 10/11] update per lib50 pr --- submit50/__main__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/submit50/__main__.py b/submit50/__main__.py index 824daea..7ea5ed5 100644 --- a/submit50/__main__.py +++ b/submit50/__main__.py @@ -71,6 +71,7 @@ def prompt(honesty, included, excluded): else: raise Error(_("No files in this directory are expected for submission.")) + # Files that won't be submitted if excluded: cprint(_("Files that won't be submitted:"), "yellow") @@ -81,6 +82,11 @@ def prompt(honesty, included, excluded): if not honesty: return True + if honesty is True: + honesty = _("Keeping in mind the course's policy on " + "academic honesty, are you sure you want to " + "submit these files?") + readline.clear_history() try: From aa3b71a3c42cf9ffab23b9b4ef00fc2c65a1cdd2 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 1 Jan 2021 12:24:24 -0500 Subject: [PATCH 11/11] re-added readline, tweaked logic --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 33158cc..6a60220 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,6 @@ entry_points={ "console_scripts": ["submit50=submit50.__main__:main"] }, - version="3.0.3", + version="3.0.4", include_package_data=True )