Пример #1
0
    def check(self, plugin):
        """
        Parses plugin.require(). Plase refere plugin.Plugin-documentation
        """
        requirements_iter = plugin.require()
        if requirements_iter is None:
            return True

        plugin_requirements = self._plugin_get_requirements(requirements_iter)

        if not self._check_plattform(plugin_requirements["plattform"]):
            required_plattform = ", ".join(plugin_requirements["plattform"])
            return "Requires os {}".format(required_plattform)

        if not self._check_python(plugin_requirements["python"]):
            required_python = ", ".join(plugin_requirements["python"])
            return "Requires Python {}".format(required_python)

        if not self._check_network(plugin_requirements["network"], plugin):
            return "Requires networking"

        natives_ok = self._check_native(plugin_requirements["native"], plugin)
        if natives_ok is not True:
            return natives_ok

        return True
Пример #2
0
    def check(self, plugin):
        """
        Parses plugin.require(). Plase refere plugin.Plugin-documentation
        """
        plugin_requirements = self._plugin_get_requirements(plugin.require())

        if not self._check_platform(plugin_requirements["platform"]):
            required_platform = ", ".join(
                [x.name for x in plugin_requirements["platform"]])
            return "Requires os {}".format(required_platform)

        if not self._check_network(plugin_requirements["network"], plugin):
            return "Requires networking"

        natives_ok = self._check_native(plugin_requirements["native"], plugin)
        if natives_ok is not True:
            return natives_ok

        return True
Пример #3
0
    def check(self, plugin):
        """
        Parses plugin.require(). Plase refere plugin.Plugin-documentation
        """
        plugin_requirements = self._plugin_get_requirements(plugin.require())

        if not self._check_platform(plugin_requirements["platform"]):
            required_platform = ", ".join(plugin_requirements["platform"])
            return "Requires os {}".format(required_platform)

        if not self._check_python(plugin_requirements["python"]):
            required_python = ", ".join(plugin_requirements["python"])
            return "Requires Python {}".format(required_python)

        if not self._check_network(plugin_requirements["network"], plugin):
            return "Requires networking"

        natives_ok = self._check_native(plugin_requirements["native"], plugin)
        if natives_ok is not True:
            return natives_ok

        return True
Пример #4
0
    def check(self, plugin):
        """
        Parses plugin.require(). Plase refere plugin.Plugin-documentation
        """
        requirements_iter = plugin.require()
        if requirements_iter is None:
            return True

        plugin_requirements = self._plugin_get_requirements(requirements_iter)

        if not self._check_plattform(plugin_requirements["plattform"]):
            return False

        if not self._check_python(plugin_requirements["python"]):
            return False

        if not self._check_network(plugin_requirements["network"], plugin):
            return False

        if not self._check_native(plugin_requirements["native"], plugin):
            return False

        return True