c11.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import config
  2. import cognos11
  3. from pdf import pdf_merge, pdf_test
  4. import plac
  5. from enum import Enum
  6. class ExportFormat(Enum):
  7. PDF = "PDF"
  8. XML = "XML"
  9. class C11:
  10. commands = ["export", "reportoutput", "errors", "create", "mailtemplate"]
  11. def __init__(self):
  12. self.cfg = config.Config()
  13. def export(self, folder="", format="XML"):
  14. exp = cognos11.c11_export(self.cfg)
  15. exp.export_folder(folder, format)
  16. def reportoutput(self, folder=""):
  17. exp = cognos11.c11_export(self.cfg)
  18. folder2 = exp.get_folder(folder)
  19. exp.export_folder(folder, "PDF")
  20. pdf_test.missing_data(self.cfg.cognos11.reportoutput_dir + "/" + folder)
  21. pdf_merge.merge_reports_in_folder(self.cfg, folder2)
  22. def errors(self):
  23. exp = cognos11.c11_export(self.cfg)
  24. exp.export_errors()
  25. def create(self, path: str):
  26. cognos11.c11_create(self.cfg).create_path(path)
  27. def mailtemplate(self):
  28. exp = cognos11.c11_export(self.cfg)
  29. exp.mail_template("")
  30. if __name__ == "__main__":
  31. plac.Interpreter.call(C11)