Ejemplo n.º 1
0
    def run(cls, className):
        """ Launch an application through reflection """

        cls.logger.info("is attempting to run [%s] wd=%s" %
                        (className, osLib.getcwd()))

        for appCls in Application.__subclasses__():
            if className == appCls.__name__:

                os = Env.getOS()
                osVersion = Env.getOSVersion(fullName=True)
                arch = java.lang.System.getProperty('os.arch')

                app = appCls()  # get an instance of this class
                binary = app.getBinary(
                    os, osVersion,
                    arch)  # get the binary to run from the instance
                cls.logger.info('created [%s] from [%s] [%s %s %s]' %
                                (className, binary, os, osVersion, arch))

                result = subprocess.Popen(binary,
                                          shell=True,
                                          cwd=app.getWorkingDir(
                                              os, osVersion, arch))

                return app

        raise Exception(
            "Unable to find Application sub-class [%s], ensure that it is included"
            % className)
Ejemplo n.º 2
0
    def run(cls, className):
        """ Launch an application through reflection """

        cls.logger.info("is attempting to run [%s] wd=%s" % (className, osLib.getcwd()))

        for appCls in Application.__subclasses__():
            if className == appCls.__name__:

                os = Env.getOS()
                osVersion = Env.getOSVersion(fullName=True)
                arch = java.lang.System.getProperty("os.arch")

                app = appCls()  # get an instance of this class
                binary = app.getBinary(os, osVersion, arch)  # get the binary to run from the instance
                cls.logger.info("created [%s] from [%s] [%s %s %s]" % (className, binary, os, osVersion, arch))

                result = subprocess.Popen(binary, shell=True, cwd=app.getWorkingDir(os, osVersion, arch))

                return app

        raise Exception("Unable to find Application sub-class [%s], ensure that it is included" % className)