Esempio n. 1
0
    def _createCompleteFunction(cls):
        def complete_function(self, text, line, begidx, endidx):
            key = extractFullArgument(line, endidx)
            return autoCompleteListWithSeparator(key, self.fetchSupportedKeys())

        complete_function = assertConfigLoaded(complete_function)
        return complete_function
Esempio n. 2
0
    def __createCompleteFunction(cls):
        def complete_function(self, text, line, begidx, endidx):
            key = extractFullArgument(line, endidx)
            return autoCompleteListWithSeparator(key,
                                                 self.fetchSupportedKeys())

        complete_function = assertConfigLoaded(complete_function)
        return complete_function
Esempio n. 3
0
    def __createDoFunction(cls, plot_function, name):
        def do_function(self, line):
            keys = matchItems(line, self.fetchSupportedKeys())

            if len(keys) == 0:
                self.lastCommandFailed("Must have at least one %s key" % name)
                return False

            for key in keys:
                pdg = self.plotDataGatherer()
                plot_function(self.shellContext(), pdg, key)

        return assertConfigLoaded(do_function)
Esempio n. 4
0
    def _createDoFunction(cls, plot_function, name):
        def do_function(self, line):
            keys = matchItems(line, self.fetchSupportedKeys())

            if len(keys) == 0:
                self.lastCommandFailed("Must have at least one %s key" % name)
                return False

            for key in keys:
                pdg = self.plotDataGatherer()
                plot_function(self.shellContext(), pdg, key)

        return assertConfigLoaded(do_function)
Esempio n. 5
0
    def _createDoPrintFunction(cls, name):
        def do_function(self, line):
            keys = matchItems(line, self.fetchSupportedKeys())

            if len(keys) == 0:
                self.lastCommandFailed("Must have at least one %s key" % name)
                return False

            case_name = self.shellContext().ert().getEnkfFsManager().getCurrentFileSystem().getCaseName()

            for key in keys:
                pdg = self.plotDataGatherer()
                if pdg.canGatherDataForKey(key):
                    data = pdg.gatherData(self.shellContext().ert(), case_name, key)
                    print(data)
                else:
                    self.lastCommandFailed("Unable to print data for key: %s" % key)

        return assertConfigLoaded(do_function)
Esempio n. 6
0
    def __createDoPrintFunction(cls, name):
        def do_function(self, line):
            keys = matchItems(line, self.fetchSupportedKeys())

            if len(keys) == 0:
                self.lastCommandFailed("Must have at least one %s key" % name)
                return False

            case_name = self.shellContext().ert().getEnkfFsManager(
            ).getCurrentFileSystem().getCaseName()

            for key in keys:
                pdg = self.plotDataGatherer()
                if pdg.canGatherDataForKey(key):
                    data = pdg.gatherData(self.shellContext().ert(), case_name,
                                          key)
                    print(data)
                else:
                    self.lastCommandFailed("Unable to print data for key: %s" %
                                           key)

        return assertConfigLoaded(do_function)