MCPcopy Create free account
hub / github.com/DFHack/dfhack / get_version

Function get_version

conf.py:151–165  ·  view source on GitHub ↗

Return the DFHack version string, from CMakeLists.txt

()

Source from the content-addressed store, hash-verified

149# built documents.
150
151def get_version():
152 """Return the DFHack version string, from CMakeLists.txt"""
153 version = release = '' #pylint:disable=redefined-outer-name
154 pattern = re.compile(r'set\((df_version|dfhack_release)\s+"(.+?)"\)')
155 try:
156 with open('CMakeLists.txt') as f:
157 for s in f.readlines():
158 for match in pattern.findall(s.lower()):
159 if match[0] == 'df_version':
160 version = match[1]
161 elif match[0] == 'dfhack_release':
162 release = match[1]
163 return (version + '-' + release).replace('")\n', '')
164 except IOError:
165 return 'unknown'
166
167# The short X.Y version.
168# The full version, including alpha/beta/rc tags.

Callers 1

conf.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected