Esempio n. 1
0
    def process_request(self):
        """
        Processes the commandline retrieving and calling
        the necessary methods from the necessary classes.
        """

        options = OptionParser()

        opts, args = options.parse_args()

        # Remove "dispatch"
        del args[0] 

        package_name = args[0]

        # Remove package name
        del args[0]

        module_name = package_name + ".interface.commandline"

        module = None
        try:
            module = __import__(module_name, globals(), locals(), [None])
        except ImportError, e:
            pipeline.report("Error - Unable to import module \"" + module_name + "\". Import error given:")
            pipeline.report("           %s" % e)
            return
Esempio n. 2
0
    def process_request(self, args):

        method_name = args[0]

        # Remove method name
        del args[0]

        # self.args = args

        try:
            method = getattr(self, method_name)
        except AttributeError:
            pipeline.report("Error - Invalid method: %s" % method_name)
            return

        # method()
        self._call(method, args)