Skip to content

Commit

Permalink
Merge branch 'raw-docced' into 'master'
Browse files Browse the repository at this point in the history
Use raw strings for regex patterns

See merge request OpenMW/openmw!4366
  • Loading branch information
psi29a committed Sep 10, 2024
2 parents d643970 + c495a57 commit 89241a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@

try:
cmake_raw = open(project_root+'/CMakeLists.txt', 'r').read()
majorVersionMatch = re.search('set\(OPENMW_VERSION_MAJOR (\d+)\)', cmake_raw)
minorVersionMatch = re.search('set\(OPENMW_VERSION_MINOR (\d+)\)', cmake_raw)
releaseVersionMatch = re.search('set\(OPENMW_VERSION_RELEASE (\d+)\)', cmake_raw)
majorVersionMatch = re.search(r'set\(OPENMW_VERSION_MAJOR (\d+)\)', cmake_raw)
minorVersionMatch = re.search(r'set\(OPENMW_VERSION_MINOR (\d+)\)', cmake_raw)
releaseVersionMatch = re.search(r'set\(OPENMW_VERSION_RELEASE (\d+)\)', cmake_raw)
if majorVersionMatch and minorVersionMatch and releaseVersionMatch:
release = version = '.'.join((majorVersionMatch.group(1),
minorVersionMatch.group(1),
releaseVersionMatch.group(1)))
luaApiRevisionMatch = re.search('set\(OPENMW_LUA_API_REVISION (\d+)\)', cmake_raw)
luaApiRevisionMatch = re.search(r'set\(OPENMW_LUA_API_REVISION (\d+)\)', cmake_raw)
if luaApiRevisionMatch:
luaApiRevision = luaApiRevisionMatch.group(1)
ppApiRevisionMatch = re.search('set\(OPENMW_POSTPROCESSING_API_REVISION (\d+)\)', cmake_raw)
ppApiRevisionMatch = re.search(r'set\(OPENMW_POSTPROCESSING_API_REVISION (\d+)\)', cmake_raw)
if ppApiRevisionMatch:
ppApiRevision = ppApiRevisionMatch.group(1)

Expand Down

0 comments on commit 89241a5

Please sign in to comment.