c11.py 737 B

1234567891011121314151617181920212223242526272829303132333435
  1. import config
  2. import cognos11
  3. import plac
  4. from enum import Enum
  5. class ExportFormat(Enum):
  6. PDF = "PDF"
  7. XML = "XML"
  8. class C11:
  9. commands = ['export', 'reportoutput', 'errors', 'create']
  10. def export(self, folder='', format='XML'):
  11. cfg = config.Config()
  12. exp = cognos11.c11_export(cfg)
  13. exp.export_folder(folder, format)
  14. def reportoutput(self, folder=''):
  15. self.export(folder, 'PDF')
  16. def errors(self):
  17. cfg = config.Config()
  18. exp = cognos11.c11_export(cfg)
  19. exp.export_errors()
  20. def create(self, path: str):
  21. cfg = config.Config()
  22. cognos11.c11_create(cfg).create_path(path)
  23. if __name__ == '__main__':
  24. plac.Interpreter.call(C11)