Beispiel #1
0
    def _set_pythonpath(self):
        """Add user configured paths to PYTHONAPATH.

        In addition, if `use installaed robot libraries` setting is `True`, and
        a Robot Framework installation is found, remove bundled RF libraries
        from PYTHONAPATH and create spec files for the installed RF's standard
        libraries.
        """
        if self._settings['use installed robot libraries']:
            rf_version = robotlibraryloader.find_installed_robot_libraries(
                self._settings.get('installed robot version', None))
            if rf_version is not None:
                if BUNDLED_LIBRARIES_PATH in sys.path:
                    sys.path.remove(BUNDLED_LIBRARIES_PATH)
                    sys.path.append(REMOTE_LIB_PATH)
                self._settings.set('installed robot version', rf_version)
        for path in self._settings.get('pythonpath', []):
            if path not in sys.path:
                normalized = path.replace('/', os.sep)
                sys.path.insert(0, normalized)
                SYSLOG("Inserted '{0}' to sys.path.".format(normalized))
Beispiel #2
0
    def _set_pythonpath(self):
        """Add user configured paths to PYTHONAPATH.

        In addition, if `use installaed robot libraries` setting is `True`, and
        a Robot Framework installation is found, remove bundled RF libraries
        from PYTHONAPATH and create spec files for the installed RF's standard
        libraries.
        """
        if self._settings['use installed robot libraries']:
            rf_version = robotlibraryloader.find_installed_robot_libraries(
                self._settings.get('installed robot version', None))
            if rf_version is not None:
                if BUNDLED_LIBRARIES_PATH in sys.path:
                    sys.path.remove(BUNDLED_LIBRARIES_PATH)
                    sys.path.append(REMOTE_LIB_PATH)
                self._settings.set('installed robot version', rf_version)
        elif BUNDLED_LIBRARIES_PATH not in sys.path:
            sys.path.insert(0, BUNDLED_LIBRARIES_PATH)
        for path in self._settings.get('pythonpath', []):
            if path not in sys.path:
                normalized = path.replace('/', os.sep)
                sys.path.insert(0, normalized)
                SYSLOG("Inserted '{0}' to sys.path.".format(normalized))
Beispiel #3
0
    def _set_pythonpath(self):
        """Add user configured paths to PYTHONAPATH.

        In addition, if `use installaed robot libraries` setting is `True`, and
        a Robot Framework installation is found, remove bundled RF libraries
        from PYTHONAPATH and create spec files for the installed RF's standard
        libraries.
        """
        if self._settings['use installed robot libraries']:
            rf_version = robotlibraryloader.find_installed_robot_libraries(
                self._settings.get('installed robot version', None))
            if rf_version is not None:
                installation_path = os.path.normpath(
                    os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
                bundled_libraries_path = os.path.join(
                    installation_path, 'lib', 'robot', 'libraries')
                if bundled_libraries_path in sys.path:
                    sys.path.remove(bundled_libraries_path)
                self._settings.set('installed robot version', rf_version)
        for path in self._settings.get('pythonpath', []):
            if path not in sys.path:
                normalized = path.replace('/', os.sep)
                sys.path.insert(0, normalized)
                SYSLOG("Inserted '{0}' to sys.path.".format(normalized))