@@ -111,22 +111,6 @@ def concurrent_submission_retrieval_handler(action, user_id, custom):
111111 elif action == "DEL" :
112112 current .REDIS_CLIENT .delete (redis_key )
113113
114- # ------------------------------------------------------------------------------
115- def populate_uva_problems ():
116- global uva_problem_dict
117-
118- ptable = uvadb .problem
119- uvaproblems = uvadb (ptable ).select (ptable .problem_id , ptable .title )
120- uva_problem_dict = dict ([(x .problem_id , x .title ) for x in uvaproblems ])
121-
122- # ------------------------------------------------------------------------------
123- def populate_atcoder_problems ():
124- global atcoder_problem_dict
125-
126- aptable = db .atcoder_problems
127- problems = db (aptable ).select (aptable .problem_identifier , aptable .name )
128- atcoder_problem_dict = dict ([(x .problem_identifier , x .name ) for x in problems ])
129-
130114# ------------------------------------------------------------------------------
131115def flush_problem_stats ():
132116
@@ -763,9 +747,13 @@ def codechef_new_retrievals():
763747 print "Invalid arguments"
764748 sys .exit ()
765749
766- populate_uva_problems ()
767- populate_atcoder_problems ()
768-
750+ uva_problem_dict = utilities .get_problem_mappings (uvadb ,
751+ uvadb .problem ,
752+ ["problem_id" , "title" ])
753+ atcoder_problem_dict = utilities .get_problem_mappings (db ,
754+ db .atcoder_problems ,
755+ ["problem_identifier" ,
756+ "name" ])
769757 links = db (ptable ).select (ptable .id , ptable .link )
770758 for row in links :
771759 plink_to_id [row .link ] = row .id
0 commit comments