@aliases("<STR_LIT>")<EOL>@arg("<STR_LIT:-c>", "<STR_LIT>", action="<STR_LIT:store_true>", help="<STR_LIT>")<EOL>@arg("<STR_LIT>", "<STR_LIT>", dest="<STR_LIT>",<EOL>help="<STR_LIT>")<EOL>def select(course=False, tid=None, auto=False):
if course:<EOL><INDENT>update(course=True)<EOL>course = None<EOL>try:<EOL><INDENT>course = Course.get_selected()<EOL><DEDENT>except NoCourseSelected:<EOL><INDENT>pass<EOL><DEDENT>ret = {}<EOL>if not tid:<EOL><INDENT>ret = Menu.launch("<STR_LIT>",<EOL>Course.select().execute(),<EOL>course)<EOL><DEDENT>else:<EOL><INDENT>ret["<STR_LIT>"] = Course.get(Course.tid == tid)<EOL><DEDENT>if "<STR_LIT>" in ret:<EOL><INDENT>ret["<STR_LIT>"].set_select()<EOL>update()<EOL>if ret["<STR_LIT>"].path == "<STR_LIT>":<EOL><INDENT>select_a_path(auto=auto)<EOL><DEDENT>skip()<EOL>return<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL>return<EOL><DEDENT><DEDENT>else:<EOL><INDENT>selected = None<EOL>try:<EOL><INDENT>selected = Exercise.get_selected()<EOL><DEDENT>except NoExerciseSelected:<EOL><INDENT>pass<EOL><DEDENT>ret = {}<EOL>if not tid:<EOL><INDENT>ret = Menu.launch("<STR_LIT>",<EOL>Course.get_selected().exercises,<EOL>selected)<EOL><DEDENT>else:<EOL><INDENT>ret["<STR_LIT>"] = Exercise.byid(tid)<EOL><DEDENT>if "<STR_LIT>" in ret:<EOL><INDENT>ret["<STR_LIT>"].set_select()<EOL>print("<STR_LIT>".format(ret["<STR_LIT>"]))<EOL><DEDENT><DEDENT>
Select a course or an exercise.