LibreTexts / ngshare

nbgrader sharing service
https://ngshare.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
17 stars 17 forks source link

Course management #77

Closed aalmanza1998 closed 4 years ago

aalmanza1998 commented 4 years ago

Use python commands to manage a course. See README for details

lxylxy123456 commented 4 years ago

If I run python3 ngshare_management.py, I get

Traceback (most recent call last):
  File "ngshare_management.py", line 395, in <module>
    sys.exit(main())
  File "ngshare_management.py", line 389, in main
    command, optlist = parse_input(argv)
  File "ngshare_management.py", line 325, in parse_input
    command = (argv[1]).lower()
IndexError: list index out of range

Line 321 should probably be if len(argv) <= 1:

@aalmanza1998 I will review more later. Should I be running it in a JupyterHub account?

lxylxy123456 commented 4 years ago

Do you want to use something like argparse to parse arguments?

aalmanza1998 commented 4 years ago

If I run python3 ngshare_management.py, I get

Traceback (most recent call last):
  File "ngshare_management.py", line 395, in <module>
    sys.exit(main())
  File "ngshare_management.py", line 389, in main
    command, optlist = parse_input(argv)
  File "ngshare_management.py", line 325, in parse_input
    command = (argv[1]).lower()
IndexError: list index out of range

Line 321 should probably be if len(argv) <= 1:

Yes, I added the --help flag forgot to modify to modify that line. I've fixed it now, thank you! Yes, please test in JupyterHub.

aalmanza1998 commented 4 years ago

Do you want to use something like argparse to parse arguments?

I used getopt.getopt but I can switch to argparse if ya'll would like me to.

lxylxy123456 commented 4 years ago

If we change to argparse:

  1. For some reason argparse seems to be more popular: 图片
  2. Consistent with ngshare
  3. Personally I think argparse is more robost

@aalmanza1998 I think I will take over the changing job. You can worry more about other aspects & JupyterLab.

Are you using some coding style standard?

aalmanza1998 commented 4 years ago

If we change to argparse:

  1. For some reason argparse seems to be more popular: 图片
  2. Consistent with ngshare
  3. Personally I think argparse is more robost

@aalmanza1998 I think I will take over the changing job. You can worry more about other aspects & JupyterLab.

Are you using some coding style standard?

It's ok, I'll make the switch to argparse.

aalmanza1998 commented 4 years ago

I need to test after these changes.

codecov-commenter commented 4 years ago

Codecov Report

Merging #77 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #77   +/-   ##
=======================================
  Coverage   98.58%   98.58%           
=======================================
  Files          14       14           
  Lines        1629     1629           
=======================================
  Hits         1606     1606           
  Misses         23       23           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 10f9f84...10f9f84. Read the comment docs.

aalmanza1998 commented 4 years ago

Closing this because we are moving this script to the ngshare_exchange repo.