update_35.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python3
  2. # Contest Management System - http://cms-dev.github.io/
  3. # Copyright © 2018 Luca Wehrstedt <luca.wehrstedt@gmail.com>
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as
  6. # published by the Free Software Foundation, either version 3 of the
  7. # License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. """A class to update a dump created by CMS.
  17. Used by DumpImporter and DumpUpdater.
  18. This updater is no-op as we only changed a field from Integer to OID.
  19. """
  20. class Updater:
  21. def __init__(self, data):
  22. assert data["_version"] == 34
  23. self.objs = data
  24. def run(self):
  25. return self.objs