added release.txt blurb. Fixed spelling typo in Defaults.xml
[scons.git] / test / Docbook / basedir / slideshtml / image / xsltver.py
blob1296703330fba8f697edc1101a0a95f20539aa7b
1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
5 import os
6 import re
8 def detectXsltVersion(fpath):
9 """ Return a tuple with the version of the Docbook XSLT stylesheets,
10 or (0, 0, 0) if no stylesheets are installed or the VERSION
11 file couldn't be found/parsed correctly.
12 """
13 with open(os.path.join(fpath, 'VERSION'), 'rb') as fin:
14 re_version = re.compile(b"<fm:Version>([^<]+)</fm:Version>")
15 m = re_version.search(fin.read())
16 if m:
17 try:
18 return tuple(map(int, m.group(1).split(b'.')))
19 except Exception:
20 return (0, 0, 0)
22 return (0, 0, 0)
24 return (0, 0, 0)