Esempio n. 1
0
 def is_installed(self)-> bool:
     """
     Check that great or equal version installed.
     Used in DependencyManager and self.install method.
     """
     if not self.installed_version:
         self.get_installed_version()
     if self.installed_version:
         compare_result = compare_versions(self.version, self.installed_version)
         return compare_result <= 0
     return False
Esempio n. 2
0
 def has_upgrade(self)-> bool:
     """
     Checks that installed version is less then product version.
     This used as product attribute in templates for web ui.
     """
     # get installed version
     installed_version = self.get_installed_version()
     if installed_version:
         # compare installed and own version
         if compare_versions(self.version, installed_version) > 0:
             return True
     return False
Esempio n. 3
0
 def has_upgrade(self) -> bool:
     """
     Checks that installed version is less then product version.
     This used as product attribute in templates for web ui.
     """
     # get installed version
     installed_version = self.get_installed_version()
     if installed_version:
         # compare installed and own version
         if compare_versions(self.version, installed_version) > 0:
             return True
     return False
Esempio n. 4
0
 def is_installed(self) -> bool:
     """
     Check that great or equal version installed.
     Used in DependencyManager and self.install method.
     """
     if not self.installed_version:
         self.get_installed_version()
     if self.installed_version:
         compare_result = compare_versions(self.version,
                                           self.installed_version)
         return compare_result <= 0
     return False
Esempio n. 5
0
    def match(self, version) -> bool:
        """
        Сравнивает версию заданную в конструкторе с заданной в аргументе.
        """
        compare_result = compare_versions(version, self.version)

        if self.operation == '==':
            return compare_result == 0

        if self.operation == '<':
            return compare_result < 0

        if self.operation == '<=' or self.operation == '=<':
            return compare_result <= 0

        if self.operation == '>':
            return compare_result > 0

        if self.operation == '>=' or self.operation == '=>':
            return compare_result >= 0
Esempio n. 6
0
    def match(self, version)-> bool:
        """
        Сравнивает версию заданную в конструкторе с заданной в аргументе.
        """
        compare_result = compare_versions(version, self.version)

        if self.operation == '==':
            return compare_result == 0

        if self.operation == '<':
            return compare_result < 0

        if self.operation == '<=' or self.operation == '=<':
            return compare_result <= 0

        if self.operation == '>':
            return compare_result > 0

        if self.operation == '>=' or self.operation == '=>':
            return compare_result >= 0