Ejemplo n.º 1
0
def menu_load211_from_json():
    global colleges
    global china211
    if len(colleges) == 0:
        if not china211:
            china211 = obj_from_file(path_of(Config.C211_FILE))
            colleges = china211.colleges
Ejemplo n.º 2
0
def menu_load211_from_json():
    global colleges
    global china211
    if len(colleges) == 0:
        if not china211:
            china211 = obj_from_file(path_of(Config.C211_FILE))
            colleges = china211.colleges
Ejemplo n.º 3
0
def menu_parse_academies():
    print_colleges()
    c_ans = raw_input("Which college would you like to parse? ")
    c = colleges[int(c_ans)]

    college = c
    if os.path.exists(c.json_filename()):
        obj = obj_from_file(c.json_filename())
        if 0 != len(obj.academies):
            college = obj

    if 0 == len(college.academies):
        college.parse_academies()
        if len(college.academies) != 0:
            obj_to_file(college, college.json_filename())
            college.mkdirs()
Ejemplo n.º 4
0
def menu_parse_academies():
    print_colleges()
    c_ans = raw_input("Which college would you like to parse? ")
    c = colleges[int(c_ans)]

    college = c
    if os.path.exists(c.json_filename()):
        obj = obj_from_file(c.json_filename())
        if 0 != len(obj.academies):
            college = obj

    if 0 == len(college.academies):
        college.parse_academies()
        if len(college.academies) != 0:
            obj_to_file(college, college.json_filename())
            college.mkdirs()
Ejemplo n.º 5
0
def menu_parse_employees():
    print_colleges()
    c_ans = raw_input("Which college would you like to parse? ")
    c = colleges[int(c_ans)]

    college = c
    if os.path.exists(c.json_filename()):
        obj = obj_from_file(c.json_filename())
        if 0 != len(obj.academies):
            college = obj

    if 0 != len(college.academies):
        college.print_academies()
        a_ans = raw_input("Academy to parse? ")
        academy = college.academies[int(a_ans)]
        academy.parse_employees(college)
        logger.debug("parsed employees count %d"%len(academy.employees))

        if academy.employees_existed(college):
            academy.employees_to_csv(college)
            academy.to_json_file(college)
        academy.print_employees()
Ejemplo n.º 6
0
def menu_parse_employees():
    print_colleges()
    c_ans = raw_input("Which college would you like to parse? ")
    c = colleges[int(c_ans)]

    college = c
    if os.path.exists(c.json_filename()):
        obj = obj_from_file(c.json_filename())
        if 0 != len(obj.academies):
            college = obj

    if 0 != len(college.academies):
        college.print_academies()
        a_ans = raw_input("Academy to parse? ")
        academy = college.academies[int(a_ans)]
        academy.parse_employees(college)
        logger.debug("parsed employees count %d" % len(academy.employees))

        if academy.employees_existed(college):
            academy.employees_to_csv(college)
            academy.to_json_file(college)
        academy.print_employees()