Unverified Commit 5e35c2b6 authored by SUPERustam's avatar SUPERustam Committed by GitHub

Update extract_version.py

parent efbff95e
...@@ -4,14 +4,14 @@ import os ...@@ -4,14 +4,14 @@ import os
import re import re
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h') config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h')
data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0} data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0}
reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$') reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$')
with open(config_h, 'r') as fp: with open(config_h, 'r') as fp:
for l in fp: for l in fp:
m = reg.match(l) m = reg.match(l)
if m: if m:
data[m.group(1)] = int(m.group(2)) data[m.group(1)] = int(m.group(2))
print('{}.{}.{}'.format(data['MAJOR'], data['MINOR'], data['PATCH'])) print(f"{data['MAJOR']}.{data['MINOR']}.{data['PATCH']}")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment