Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSUPERustam <64551202+SUPERustam@users.noreply.github.com>2021-04-08 09:56:01 +0300
committerGitHub <noreply@github.com>2021-04-08 09:56:01 +0300
commit5e35c2b6abb3138f5227d156b7a68fcf3b0ea35d (patch)
tree6272bc85494d84418c2742ce8f7496c27538d3fa /scripts
parentefbff95ec7b869e3bd5a98edaccdfc0841e730d4 (diff)
Update extract_version.py
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/extract_version.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/extract_version.py b/scripts/extract_version.py
index 960df51b..79b5728a 100755
--- a/scripts/extract_version.py
+++ b/scripts/extract_version.py
@@ -4,14 +4,14 @@ import os
import re
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
-config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h')
-data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0}
-reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$')
+config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h')
+data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0}
+reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$')
with open(config_h, 'r') as fp:
- for l in fp:
- m = reg.match(l)
- if m:
- data[m.group(1)] = int(m.group(2))
+ for l in fp:
+ m = reg.match(l)
+ if m:
+ data[m.group(1)] = int(m.group(2))
-print('{}.{}.{}'.format(data['MAJOR'], data['MINOR'], data['PATCH']))
+print(f"{data['MAJOR']}.{data['MINOR']}.{data['PATCH']}")