Ejemplo n.º 1
0
    def __runDemo():
        if not Cli.cocoscats.isWorkflowDemoEnabled() or \
            Cli.cocoscats.getWorkflowDemoPluginCount() < 1:
            return
        Msg.show("Execute: Demo Stage")
        choices = Cli.cocoscats.getWorkflowDemoPluginChoices()
        menu = """-----------------------------------------------
Please make a selection to run demo or 'x' to exit.\n"""
        i = 1
        for choice in choices:
            menu = """{0}
[{1}]: {2}::{3}()""".format(menu, i, choice["Name"], choice["Method"])
            i += 1
        menu = """{0}
[x]: Exit
""".format(menu)
        errMsg = "Error: Valid options are: [1-{0}]".format(i - 1)
        while True:
            Msg.showRaw(menu)
            response = input()
            if response == "x" or response == "X":
                break
            if not Text.isInt(response):
                Msg.showRaw(errMsg)
                continue
            response = int(response)
            if response < 1 or response >= i:
                Msg.showRaw(errMsg)
                continue
            j = response - 1
            ret = Cli.cocoscats.runDemo(choices[j]["Name"],
                                        choices[j]["Method"])
            if ret:
                Msg.showWarning("Demo returned an error")
Ejemplo n.º 2
0
 def __runTranslator():
     Msg.show("Execute: Translation Stage")
     content = Cli.cocoscats.runTranslator()
     if Cli.cocoscats.isWorkflowEditTrue("Translator"):
         Cli.__runEditor(Cli.cocoscats.frameworkParams["translatorPath"],
                         Cli.cocoscats.frameworkParams["translatorPath"])
     if Cli.cocoscats.isWorkflowDebugTrue("Translator"):
         Msg.showRaw(content)
Ejemplo n.º 3
0
 def __runOutput():
     Msg.show("Execute: Output Stage")
     content = Cli.cocoscats.runOutput()
     if Cli.cocoscats.isWorkflowEditTrue("Output"):
         Cli.__runEditor(Cli.cocoscats.frameworkParams["outputPath"],
                         Cli.cocoscats.frameworkParams["outputPath"])
     if Cli.cocoscats.isWorkflowDebugTrue("Output"):
         Msg.showRaw(content)
Ejemplo n.º 4
0
 def __runAnalyzer():
     Msg.show("Execute: Analyzer Stage")
     content = Cli.cocoscats.runAnalyzer()
     if Cli.cocoscats.isWorkflowEditTrue("Analyzer"):
         Cli.__runEditor(Cli.cocoscats.frameworkParams["analyzerPath"],
                         Cli.cocoscats.frameworkParams["analyzerPath"])
     if Cli.cocoscats.isWorkflowDebugTrue("Analyzer"):
         Msg.showRaw(content)
Ejemplo n.º 5
0
 def createPassword():
     Security.deletePassword()
     p = Security.promptForPassword(True)
     Msg.flush()
     Msg.show("Thanks ... please wait")
     Msg.flush()
     h = Security.hashAndSaltPassword(p)
     File.setContent(Security.__passwordPath, {"Password": h}, asJson=True)
Ejemplo n.º 6
0
 def showAllPluginFiles():
     Msg.show("Plugins")
     Framework.showPluginFiles("IO")
     Framework.showPluginFiles("Analyzer")
     Framework.showPluginFiles("Translator")