forked from chenmozhijin/LDDC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_helper.py
More file actions
27 lines (22 loc) · 866 Bytes
/
build_helper.py
File metadata and controls
27 lines (22 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# SPDX-FileCopyrightText: Copyright (C) 2024 沉默の金 <cmzj@cmzj.org>
# SPDX-License-Identifier: GPL-3.0-only
import argparse
import time
from LDDC.utils.version import __version__, parse_version
parser = argparse.ArgumentParser()
parser.add_argument('--task', choices=['get_version', 'get_year', 'get_num_version', 'get_qt_translations_path'], required=True)
arg = parser.parse_args()
num_version = ".".join(str(i) for i in parse_version(__version__)[:3])
year = time.strftime("%Y")
if year != '2024':
year = "2024-" + year
match arg.task:
case 'get_version':
print(__version__[1:])
case 'get_num_version':
print(num_version)
case 'get_year':
print(year)
case 'get_qt_translations_path':
from PySide6.QtCore import QLibraryInfo
print(QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath))