commit: c3bd6d243ead957e0b6bd2c7d5114392e75b3289 Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org> AuthorDate: Thu Oct 16 19:16:58 2014 +0000 Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org> CommitDate: Fri Jun 19 19:19:14 2015 +0000 URL: https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=c3bd6d24
config.py: Improves package version checking With the previous method of setting the package version you were unable to pass the package version to webapp-config if it had more than one decimal point (ex: 1.0.1 wouldn't work), this commit attempts to fix that issue. WebappConfig/config.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/WebappConfig/config.py b/WebappConfig/config.py index 10a6f26..5eb4584 100644 --- a/WebappConfig/config.py +++ b/WebappConfig/config.py @@ -990,11 +990,18 @@ class Config: else: OUT.die('Invalid package name') - try: - self.config.set('USER', 'pvr', str(float(args[1]))) - except ValueError: + argsvr = args[1].split('.') + if len(argsvr) == 1: OUT.die('Invalid package version: %(pvr)s' % {'pvr': args[1]}) + pvr = '' + for i in range(0, len(argsvr)): + if not i == len(argsvr) - 1: + pvr += argsvr[i] + '.' + else: + pvr += argsvr[i] + self.config.set('USER', 'pvr', pvr) + # -------------------------------------------------------------------- # Helper functions