regolith/classlist.py
def register(rc):
    """Entry point for registering classes."""
    if rc.format is None:
        rc.format = os.path.splitext(rc.filename)[1][1:]
    loader = LOADERS[rc.format]
    students = loader(rc.filename)
    if rc.dry_run:
        pprint(students)
        return
    if rc.db is None:
        dbs = rc.client.keys()
        if len(dbs) == 1:
            rc.db = list(dbs)[0]
        else:
            raise RuntimeError('More than one database present in run control, '
                               'please select one with the "--db" option. '
                               'Available dbs are: ' + pformat(dbs))
    add_students_to_db(students, rc)
    add_students_to_course(students, rc)
Entry point for registering classes.
Entry point for registering classes.
Entry point for registering classes .
def register(rc):
    if rc.format is None:
        rc.format = os.path.splitext(rc.filename)[1][1:]
    loader = LOADERS[rc.format]
    students = loader(rc.filename)
    if rc.dry_run:
        pprint(students)
        return
    if rc.db is None:
        dbs = rc.client.keys()
        if len(dbs) == 1:
            rc.db = list(dbs)[0]
        else:
            raise RuntimeError('More than one database present in run control, '
                               'please select one with the "--db" option. '
                               'Available dbs are: ' + pformat(dbs))
    add_students_to_db(students, rc)
    add_students_to_course(students, rc)
def register ( rc ) : if rc . format is None : rc . format = os . path . splitext ( rc . filename ) [ 1 ] [ 1 : ] loader = LOADERS [ rc . format ] students = loader ( rc . filename ) if rc . dry_run : pprint ( students ) return if rc . db is None : dbs = rc . client . keys ( ) if len ( dbs ) == 1 : rc . db = list ( dbs ) [ 0 ] else : raise RuntimeError ( 'More than one database present in run control, ' 'please select one with the "--db" option. ' 'Available dbs are: ' + pformat ( dbs ) ) add_students_to_db ( students , rc ) add_students_to_course ( students , rc )
Entry point for registering classes.
Entry point for registering classes .
"""Entry point for registering classes."""
rc