Exemplo n.º 1
0
def create_std_map():
    data = extract_data()
    data = data['Students']
    global std_map
    for item in data:
        std = Student(item['Rollno'])
        std.cached_data(item['Name'],item['Gender'],item['Sgpa'] \
            ,item['Cgpa'],item['Points'],item['Rank'],item['G_rank'])
        std_map[item['Rollno']] = std
Exemplo n.º 2
0
def create_std_map(file_name=default_file_name):
    if (debug): print("created map " + file_name)
    data = extract_data(file_name)
    data = data['Students']
    global std_map
    for item in data:
        std = Student(item['Rollno'])
        std.cached_data(item['Name'],item['Gender'],item['Sgpa'] \
            ,item['Cgpa'],item['Points'],item['Rank'],item['G_rank'])
        std_map[item['Rollno']] = std
Exemplo n.º 3
0
def modifier(file_name=default_file_name):
    data = extract_data()
    data = data['Students']
    for i in range(len(data)):
        item = data[i]
        std = Student(item['Rollno'])
        std.cached_data(item['Name'],item['Gender'],item['Sgpa'] \
            ,item['Cgpa'],item['Points'],item['Rank'],item['G_rank'])

        gender = edit_gender(std)
        if (gender == 'q'):
            break
        elif (gender == 'u'):
            std.gender = 'u'
        else:
            std.gender = gender

        data[i] = create_info_dict(std.rank, std)
    file_name = abs_path(file_name)
    create_file(file_name)
    new_data = extract_data()
    new_data['Students'] = data
    write_data(new_data)
Exemplo n.º 4
0
def modifier(file_name=cache_path):
    data = extract_data()
    data = data['Students']
    b_rank = 1
    g_rank = 1
    for i in range(len(data)):
        item = data[i]
        std = Student(item['Rollno'])
        std.cached_data(item['Name'],item['Gender'],item['Sgpa'] \
            ,item['Cgpa'],item['Points'],item['Rank'],item['G_rank'])

        if(std.gender == 'b'):
            std.g_rank = b_rank
            b_rank +=1
        if(std.gender == 'g'):
            std.g_rank = g_rank
            g_rank +=1

        data[i] = create_info_dict(std.rank,std)
    file_name = abs_path(file_name)
    create_file(file_name)
    new_data = extract_data()
    new_data['Students'] = data
    write_data(new_data)