really = not test

if __name__ == "__main__":

    moodle = MoodleTree()
    autosend = AutoSendTree()
    moodle.process()
    autosend.process()

    sql = MoodleDBSession()
    db = MoodleDBSession()

    Group = db.table_string_to_class('groups')
    User = db.table_string_to_class('user')
    Enrol = db.table_string_to_class('user_enrolments')
    php = CallPHP()

    renames = defaultdict(list)

    for student in moodle.students.get_objects():
        other = autosend.students.get_key(student.idnumber)
        if not other:
            continue
        counter = defaultdict(list)
        not_in_autosend = []
        for group in student.groups:
            if '-' in group.group_id:
                g, s = group.group_id.split('-')

                if autosend.groups.get_key(group.group_id):
                    counter[g].append(group)
from psmdlsyncer.php import CallPHP


if __name__ == "__main__":
    p = CallPHP()
    here = ""
    while here.strip() != "quit":
        here = input()
        p.command(here.strip(), "")