kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
rodzic
69cc2dcfb4
commit
f68d3c2fb7
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
VERSION = "0.4.0-pre"
|
VERSION = "0.4.0"
|
||||||
VERSION_URL = (
|
VERSION_URL = (
|
||||||
"https://raw.githubusercontent.com/"
|
"https://raw.githubusercontent.com/"
|
||||||
"NanoVNA-Saver/nanovna-saver/master/NanoVNASaver/About.py")
|
"NanoVNA-Saver/nanovna-saver/master/NanoVNASaver/About.py")
|
||||||
|
|
|
@ -15,8 +15,10 @@
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
from lib2to3.pytree import type_repr
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
from typing import Type
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -25,8 +27,8 @@ class Version:
|
||||||
RXP = re.compile(r"""^
|
RXP = re.compile(r"""^
|
||||||
\D*
|
\D*
|
||||||
(?P<major>\d+)\.
|
(?P<major>\d+)\.
|
||||||
(?P<minor>\d+)\.
|
(?P<minor>\d+)\.?
|
||||||
(?P<revision>\d+)
|
(?P<revision>\d+)?
|
||||||
(?P<note>.*)
|
(?P<note>.*)
|
||||||
$""", re.VERBOSE)
|
$""", re.VERBOSE)
|
||||||
|
|
||||||
|
@ -41,6 +43,8 @@ class Version:
|
||||||
self.data = Version.RXP.search(vstring).groupdict()
|
self.data = Version.RXP.search(vstring).groupdict()
|
||||||
for name in ("major", "minor", "revision"):
|
for name in ("major", "minor", "revision"):
|
||||||
self.data[name] = int(self.data[name])
|
self.data[name] = int(self.data[name])
|
||||||
|
except TypeError:
|
||||||
|
self.data["revision"] = 0
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logger.error("Unable to parse version: %s", vstring)
|
logger.error("Unable to parse version: %s", vstring)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue