Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
TimStewartJ committed Mar 13, 2023
1 parent 583196d commit daf7b22
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 13 deletions.
4 changes: 1 addition & 3 deletions ngshare_exchange/course_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import argparse
from urllib.parse import quote


# https://www.geeksforgeeks.org/print-colors-python-terminal/
def prRed(skk, exit=True):
print('\033[91m {}\033[00m'.format(skk))
Expand Down Expand Up @@ -83,7 +84,6 @@ def check_status_code(response):


def check_message(response):

response = response.json()
if not response['success']:
prRed(response['message'])
Expand Down Expand Up @@ -460,12 +460,10 @@ def parse_args(argv):


def main(argv=None):

argv = argv or sys.argv[1:]
args = parse_args(argv)
args.func(args)


if __name__ == '__main__':

sys.exit(main())
4 changes: 1 addition & 3 deletions ngshare_exchange/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


class Exchange(ABCExchange):

username = (
os.environ['JUPYTERHUB_USER']
if 'JUPYTERHUB_USER' in os.environ
Expand All @@ -38,7 +37,6 @@ class Exchange(ABCExchange):

@property
def ngshare_url(self):

if self._ngshare_url:
return self._ngshare_url
if 'PROXY_PUBLIC_SERVICE_HOST' in os.environ:
Expand Down Expand Up @@ -190,7 +188,7 @@ def decode_dir(self, src_dir, dest_dir, ignore=None, noclobber=False):

def encode_dir(self, src_dir, ignore=None):
encoded_files = []
for (subdir, dirs, files) in os.walk(src_dir):
for subdir, dirs, files in os.walk(src_dir):
for file_name in files:
file_path = subdir + os.sep + file_name
data_bytes = open(file_path, 'rb').read()
Expand Down
2 changes: 0 additions & 2 deletions ngshare_exchange/release_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class ExchangeReleaseAssignment(Exchange, ABCExchangeReleaseAssignment):

force = Bool(
False, help='Force overwrite existing files in the exchange.'
).tag(config=True)
Expand Down Expand Up @@ -44,7 +43,6 @@ def init_src(self):
self.coursedir.assignment_id,
)
if os.path.isdir(source):

# Looks like the instructor forgot to assign
self.fail(
'Assignment found in "{}" but not "{}", run `nbgrader generate_assignment` first.'.format(
Expand Down
4 changes: 0 additions & 4 deletions ngshare_exchange/tests/test_fetch_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


class TestExchangeFetchFeedback(TestExchange):

timestamp = 'some_timestamp'

def _mock_bad_feedback(self):
Expand Down Expand Up @@ -70,7 +69,6 @@ def _new_fetch_feedback(
assignment_id=TestExchange.assignment_id,
student_id=TestExchange.student_id,
):

retvalue = self._new_exchange_object(
ExchangeFetchFeedback, course_id, assignment_id, student_id
)
Expand Down Expand Up @@ -122,7 +120,6 @@ def test_no_course_id(self):
assert issubclass(type(e), ExchangeError)

def test_fetch(self):

# set chache folder

submission_name = '{}+{}+{}'.format(
Expand Down Expand Up @@ -150,7 +147,6 @@ def test_fetch(self):
assert actual_file.read() == reference_file.read()

def test_fetch_path_includes_course(self):

# set chache folder

submission_name = '{}+{}+{}'.format(
Expand Down
1 change: 0 additions & 1 deletion ngshare_exchange/tests/test_release_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class TestExchangeReleaseFeedback(TestExchange):

feedback_file = ''
timestamp = ''

Expand Down

0 comments on commit daf7b22

Please sign in to comment.