kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
More robust parsing of version numbers.
rodzic
a50e07fd39
commit
7ffcf93b75
|
@ -259,12 +259,13 @@ class Version:
|
|||
|
||||
def __init__(self, version_string):
|
||||
self.version_string = version_string
|
||||
results = re.match(r"(.*\D+)?(\d+)\.(\d+)\.(\d+)(.*)", version_string)
|
||||
results = re.match(r"(.*\s+)?(\d+)\.(\d+)\.(\d+)(.*)", version_string)
|
||||
if results:
|
||||
self.major = int(results.group(2))
|
||||
self.minor = int(results.group(3))
|
||||
self.revision = int(results.group(4))
|
||||
self.note = results.group(5)
|
||||
print("Parsed version as %d.%d.%d%s" % (self.major, self.minor, self.revision, self.note))
|
||||
logger.debug("Parsed version as %d.%d.%d%s", self.major, self.minor, self.revision, self.note)
|
||||
|
||||
@staticmethod
|
||||
|
|
Ładowanie…
Reference in New Issue