# return 1 if self.version > version2 # return 0 if self.version == version2 # return -1 if self.version < version2 # return False if not comparable
(self, version2, separator=". |-", ignorecase=True)
| 254 | ] |
| 255 | |
| 256 | def compare(self, version2, separator=". |-", ignorecase=True): |
| 257 | """ |
| 258 | # return 1 if self.version > version2 |
| 259 | # return 0 if self.version == version2 |
| 260 | # return -1 if self.version < version2 |
| 261 | # return False if not comparable |
| 262 | """ |
| 263 | if "rc" in self.version and not "rc" in version2: |
| 264 | a = self._preprocess( |
| 265 | self.version.split("rc")[0].strip("-"), separator, ignorecase |
| 266 | ) |
| 267 | b = b = self._preprocess(version2, separator, ignorecase) |
| 268 | if ((a > b) - (a < b)) == 0: |
| 269 | return -1 |
| 270 | else: |
| 271 | return (a > b) - (a < b) |
| 272 | else: |
| 273 | a = self._preprocess(self.version, separator, ignorecase) |
| 274 | b = self._preprocess(version2, separator, ignorecase) |
| 275 | try: |
| 276 | return (a > b) - (a < b) |
| 277 | except: |
| 278 | return False |
| 279 | |
| 280 | |
| 281 | SUPPORTED_PLATFORM_MACHINE = { |
no test coverage detected