Skip to content

Commit

Permalink
Version 0.4.0
Browse files Browse the repository at this point in the history
Allow 2 digit versions. Fixes #483
  • Loading branch information
zarath committed Apr 1, 2022
1 parent 69cc2dc commit f68d3c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NanoVNASaver/About.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

VERSION = "0.4.0-pre"
VERSION = "0.4.0"
VERSION_URL = (
"https://raw.githubusercontent.com/"
"NanoVNA-Saver/nanovna-saver/master/NanoVNASaver/About.py")
Expand Down
8 changes: 6 additions & 2 deletions NanoVNASaver/Version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from lib2to3.pytree import type_repr
import logging
import re
from typing import Type

logger = logging.getLogger(__name__)

Expand All @@ -25,8 +27,8 @@ class Version:
RXP = re.compile(r"""^
\D*
(?P<major>\d+)\.
(?P<minor>\d+)\.
(?P<revision>\d+)
(?P<minor>\d+)\.?
(?P<revision>\d+)?
(?P<note>.*)
$""", re.VERBOSE)

Expand All @@ -41,6 +43,8 @@ def __init__(self, vstring: str = "0.0.0"):
self.data = Version.RXP.search(vstring).groupdict()
for name in ("major", "minor", "revision"):
self.data[name] = int(self.data[name])
except TypeError:
self.data["revision"] = 0
except AttributeError:
logger.error("Unable to parse version: %s", vstring)

Expand Down

0 comments on commit f68d3c2

Please sign in to comment.