projectsettings.py 379 B

12345678910111213
  1. '''Serialize project settings.'''
  2. import json
  3. from terroroftinytown.format.base import BaseWriter
  4. class ProjectSettingsWriter(BaseWriter):
  5. def write_project(self, project):
  6. text = json.dumps(project.to_dict())
  7. self.fp.write(text.encode('utf-8'))
  8. def write_shortcode(self, shortcode, url, encoding):
  9. raise Exception('This method is not used.')