diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-10-12 12:57:27 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-10-12 12:57:27 +0200 |
commit | fe0002e7fd5a3631d6a7cd8b0a3cdbd2b55d7aa1 (patch) | |
tree | 080f322856c38e19e6819f07786a24d88674271f /server | |
parent | 0850ea13c19d4f2a382fd7d4bcf6333f446fa68b (diff) |
Remove unused server.problems.list_problems
Diffstat (limited to 'server')
-rw-r--r-- | server/problems.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/server/problems.py b/server/problems.py index bc124ca..c63d923 100644 --- a/server/problems.py +++ b/server/problems.py @@ -82,34 +82,3 @@ def solutions_for_problems(language, tuples): except AttributeError as me: pass return '\n'.join(solutions) - -def list_problems(language): - conn = get_connection() - try: - cur = conn.cursor() - try: - cur.arraysize = 1000 - cur.execute('select l.identifier, l.name, g.identifier, g.name, p.identifier, p.name from problem p inner join language l on l.id = p.language_id and l.identifier = \''+language+'\' inner join problem_group g on g.id = p.problem_group_id order by l.identifier, g.identifier, p.identifier') - result = [] - previous_language = '' - previous_group = '' - current_sublist = None - row = cur.fetchone() - while row: - current_language = row[0] - current_group = row[2] - if previous_language != current_language or previous_group != current_group: - current_sublist = [] - result.append({'identifier': {'language': current_language, 'group': current_group}, - 'name': {'language': row[1], 'group': row[3]}, - 'problems': current_sublist}) - previous_group = current_group - previous_language = current_language - current_sublist.append({'identifier': row[4], 'name': row[5]}) - row = cur.fetchone() - return result - finally: - cur.close() - finally: - conn.commit() - return_connection(conn) |