2021-10-15 12:11:26 +02:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
def get_version(configfile=None):
|
|
|
|
res = None
|
|
|
|
regex = re.compile(".*OC_Version.*\((\d+),(\d+),(\d+),(\d+).*")
|
|
|
|
with open(configfile, "r") as f:
|
|
|
|
lines = f.readlines()
|
|
|
|
for l in lines:
|
|
|
|
res = regex.match(l.strip("\n"))
|
|
|
|
if res:
|
|
|
|
return ".".join(res.groups())
|
2023-03-10 00:09:04 +01:00
|
|
|
return None
|