-
Notifications
You must be signed in to change notification settings - Fork 957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check GitHub for exclude files #115
Changes from 3 commits
af9dffa
656824b
23c9cf4
2b8b515
fb9058b
604fa46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -418,9 +418,17 @@ def submit(org, problem): | |
if problem.split("/")[0].isdigit(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will go away, actually, per the other PR. |
||
branch = os.path.join("cs50", problem) | ||
|
||
# ensure problem exists | ||
file, submit.EXCLUDE = tempfile.mkstemp() | ||
url = "https://cs50.me/excludes/{}/".format(branch) | ||
|
||
# separate branch into problem slug and source repo | ||
branch = branch.rstrip("@cs50/checks") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it necessary to strip this off, if it was, for whatever reason, explicitly mentioned? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's necessary so that students don't end up with some of their submissions on |
||
try: | ||
slug, src = branch.split("@", 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was an old version, not required anymore. Fixed. |
||
except ValueError: | ||
slug, src = branch, "cs50/checks" | ||
|
||
# ensure problem exists | ||
url = "https://raw.githubusercontent.com/{}/master/{}/submit50/exclude".format(src, slug) | ||
try: | ||
urllib.request.urlretrieve(url, filename=submit.EXCLUDE) | ||
lines = open(submit.EXCLUDE) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for trailing slash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!