import config
import cognos11
import plac
from enum import Enum


class ExportFormat(Enum):
    PDF = "PDF"
    XML = "XML"


class C11:
    commands = ['export', 'reportoutput', 'errors', 'create']

    def export(self, folder='', format='XML'):
        cfg = config.Config()
        exp = cognos11.c11_export(cfg)
        exp.export_folder(folder, format)

    def reportoutput(self, folder=''):
        self.export(folder, 'PDF')
        

    def errors(self):
        cfg = config.Config()
        exp = cognos11.c11_export(cfg)
        exp.export_errors()

    def create(self, path: str):
        cfg = config.Config()
        cognos11.c11_create(cfg).create_path(path)


if __name__ == '__main__':
    plac.Interpreter.call(C11)
