def main():
parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument("-l", "--list", default=False, action='store_true',
help="when given, lists known notebooks and does *not* open anything")
parser.add_argument("-c", "--course-gitdir", default=default_course_gitdir,
help="""location of a git repo where to fetch notebooks;
needed in order to generate relevant URLs""")
parser.add_argument("-i", "--index", default=0, type=int,
help="index in the list of known notebooks - run with -l to see list")
parser.add_argument("-u", "--user", default='student-0001',
help="username for opening that notebook")
parser.add_argument("-s", "--sleep", default=3, type=int,
help="delay in seconds to sleep between actions")
args = parser.parse_args()
course, notebooks = list_notebooks(args.course_gitdir)
if args.list:
list(notebooks)
else:
run(args.user, course, notebooks, args.index, args.sleep)
评论列表
文章目录