Skip to content

Commit 82d690c

Browse files
Add updater for version 14
1 parent 03dbc91 commit 82d690c

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

cmscontrib/updaters/update_14.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env python2
2+
# -*- coding: utf-8 -*-
3+
4+
# Contest Management System - http://cms-dev.github.io/
5+
# Copyright © 2015 Stefano Maggiolo <s.maggiolo@gmail.com>
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU Affero General Public License as
9+
# published by the Free Software Foundation, either version 3 of the
10+
# License, or (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU Affero General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Affero General Public License
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
20+
"""A class to update a dump created by CMS.
21+
22+
Used by ContestImporter and DumpUpdater.
23+
24+
This updater is no-op as the new field (score mode) has a proper
25+
default value.
26+
27+
"""
28+
29+
from __future__ import absolute_import
30+
from __future__ import unicode_literals
31+
from __future__ import print_function
32+
33+
34+
class Updater(object):
35+
36+
def __init__(self, data):
37+
assert data["_version"] == 13
38+
self.objs = data
39+
40+
def run(self):
41+
return self.objs

0 commit comments

Comments
 (0)