4 version, a module for pymecavideo:
5 a program to track moving points
in a video frameset
6 This module
is just an utility to manage the version number which
7 is important
for releases of pymecavideo
9 Copyright (C) 2008-2018 Georges Khaznadar
11 This program
is free software: you can redistribute it
and/
or modify
12 it under the terms of the GNU General Public License
as published by
13 the Free Software Foundation, either version 3 of the License,
or
14 (at your option) any later version.
16 This program
is distributed
in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License
for more details.
21 You should have received a copy of the GNU General Public License
22 along
with this program. If
not, see <http://www.gnu.org/licenses/>.
31 def __init__(self, majeur, mineur, nuance=""):
36 def __lt__(self, other):
37 return (self.
majeur < other.majeur)
or \
38 (self.
majeur == other.majeur
and self.
mineur < other.mineur)
46def str2version(chaine):
48 extrait la version d'une chaîne de caractères
50 m = re.match(r"(\d+)\.(\d+)(.*)", chaine)
52 return version(int(m.group(1)), int(m.group(2)), m.group(3))
55def versionFromDebianChangelog():
57 Renvoie une version selon le contenu éventuel d'un fichier
58 /usr/share/doc/python3-mecavideo/changelog.Debian.gz
60 packageName = "python3-mecavideo"
61 changelog = os.path.join(
"/usr/share/doc", packageName,
"changelog.Debian.gz")
62 if os.path.exists(changelog):
63 with gzip.open(changelog)
as chlog:
64 firstline = chlog.readline().strip().decode(
"utf-8")
65 m = re.match(
r"^pymecavideo \((.*)\).*$", firstline)
67 return str2version(m.group(1))
74Version =
version(8, 1,
'~rc3-1')
79v = versionFromDebianChangelog()
82if __name__ ==
"__main__":