Skip to content

Commit

Permalink
整理一点代码并调整specs,调整生成后的引用
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuJiewenTT committed May 13, 2023
1 parent 19c10e8 commit 1decc06
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 42 deletions.
1 change: 1 addition & 0 deletions BuildTypeDirectory
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Nothing here.
22 changes: 22 additions & 0 deletions MCMDC/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@
else:
isBuilt = True
print(f'{LOGMODE_LOADING_OHEADER}This is a builded version.')
basedir = osp.normpath(osp.join(basedir, '..'))
print(f'{LOGMODE_LOADING_OHEADER}Basedir is reset to [{basedir}].')

BuildType: str
BuildTypeDirectory = 'Directory'
BuildTypeFile = 'File'
BuildTypeNone = 'None'

try:
if BuildType is None: pass;
except Exception as e:
if isBuilt:
if osp.exists(osp.join(basedir, 'BuildTypeDirectory')):
BuildType = BuildTypeDirectory
print(f'{LOGMODE_LOADING_OHEADER}Build Type: Folder.')
# basedir_folder = osp.dirname(osp.abspath(sys.argv[0]))
# print(f'{LOGMODE_LOADING_OHEADER}basedir_folder is set to [{basedir_folder}].')
else:
BuildType = BuildTypeFile
print(f'{LOGMODE_LOADING_OHEADER}Build Type: Single.')
else:
BuildType = BuildTypeNone

devpause: bool

Expand Down
10 changes: 8 additions & 2 deletions MCMDC/docs_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,16 @@ def GiveDoc(file: str, lang: str = 'en-us', executor: str = 'start', startOption

__moreimport__()

# if isBuilt and BuildType == BuildTypeDirectory:
# librarydir = basedir_folder
# else:
# librarydir = basedir
librarydir = basedir

if isBuilt:
filepath = os.path.join(basedir, 'docs')
filepath = os.path.join(librarydir, 'docs')
else:
filepath = os.path.join(basedir, '..', 'docs')
filepath = os.path.join(librarydir, '..', 'docs')
filepath = os.path.normpath(filepath)

print_debug(file, enabled=False)
Expand Down
6 changes: 3 additions & 3 deletions MCMDC_CUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import os.path as osp
import MCMDC
from MCMDC.constants import *
if isBuilt:
MCMDC.constants.basedir = basedir = osp.normpath(osp.join(basedir, '..'))
print(f'{LOGMODE_LOADING_OHEADER}Basedir is set to [{basedir}].')
# if isBuilt:
# MCMDC.constants.basedir = basedir = osp.normpath(osp.join(basedir, '..'))
# print(f'{LOGMODE_LOADING_OHEADER}Basedir is set to [{basedir}].')
# LOGMODE_LOADING_OHEADER = '[ProgramLoad]: '

if __name__ == "__main__":
Expand Down
76 changes: 39 additions & 37 deletions version_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,44 @@
#
# For more details about fixed file info 'ffi' see:
# http://msdn.microsoft.com/en-us/library/ms646997.aspx

VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(1, 0, 0, 0), # 文件版本
prodvers=(1, 0, 0, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
flags=0x0,
# The operating system for which this file was designed.
# 0x4 - NT and there is no need to change it.
OS=0x4,
# The general type of file.
# 0x1 - the file is an application.
fileType=0x1, # 类型
# The function of the file.
# 0x0 - the function is not defined for this fileType
subtype=0x0,
# Creation date and time stamp.
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
u'040904B0',
[StringStruct(u'CompanyName', u'-'),
StringStruct(u'FileDescription', u'《我的世界》模组依赖项检查工具, 联系邮箱: [email protected]'), # 文件说明
StringStruct(u'FileVersion', u'1.0.0'),
StringStruct(u'InternalName', u'MCMDC'),
StringStruct(u'LegalCopyright', u'LiuJiewen'), #版权
StringStruct(u'OriginalFilename', u'MCMDC.exe'), #原始文件名
StringStruct(u'ProductName', u'Minecraft Mod Dependency Check'), #产品名称
StringStruct(u'ProductVersion', u'1.0.0')]) #产品版本
]),
VarFileInfo([VarStruct(u'Translation', [2052, 1200])]) # 语言
]
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(1, 0, 0, 0), # 文件版本
prodvers=(1, 0, 0, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
flags=0x0,
# The operating system for which this file was designed.
# 0x4 - NT and there is no need to change it.
OS=0x4,
# The general type of file.
# 0x1 - the file is an application.
fileType=0x1, # 类型
# The function of the file.
# 0x0 - the function is not defined for this fileType
subtype=0x0,
# Creation date and time stamp.
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
u'040904B0',
[StringStruct(u'CompanyName', u''),
StringStruct(u'FileDescription', u'《我的世界》模组依赖项检查工具(A版)。联系邮箱: [email protected]。此程序开源,Github账户:LiuJiewenTT。'), # 文件说明
StringStruct(u'FileVersion', u'1.0.0'),
StringStruct(u'InternalName', u'MCMDC'),
StringStruct(u'LegalCopyright', u'刘杰文'), #版权
StringStruct(u'OriginalFilename', u'MCMDC.exe'), #原始文件名
StringStruct(u'ProductName', u'Minecraft Mod Dependency Check'), #产品名称
StringStruct(u'ProductVersion', u'1.0.0')]) #产品版本
]
),
VarFileInfo([VarStruct(u'Translation', [2052, 1200])]) # 语言
]
)
45 changes: 45 additions & 0 deletions version_info_d.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# UTF-8
#
# For more details about fixed file info 'ffi' see:
# http://msdn.microsoft.com/en-us/library/ms646997.aspx

VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(1, 0, 0, 0), # 文件版本
prodvers=(1, 0, 0, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
flags=0x0,
# The operating system for which this file was designed.
# 0x4 - NT and there is no need to change it.
OS=0x4,
# The general type of file.
# 0x1 - the file is an application.
fileType=0x1, # 类型
# The function of the file.
# 0x0 - the function is not defined for this fileType
subtype=0x0,
# Creation date and time stamp.
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
u'040904B0',
[StringStruct(u'CompanyName', u''),
StringStruct(u'FileDescription', u'《我的世界》模组依赖项检查工具(B版)。联系邮箱: [email protected]。此程序开源,Github账户:LiuJiewenTT。'), # 文件说明
StringStruct(u'FileVersion', u'1.0.0'),
StringStruct(u'InternalName', u'MCMDC'),
StringStruct(u'LegalCopyright', u'刘杰文'), #版权
StringStruct(u'OriginalFilename', u'MCMDC.exe'), #原始文件名
StringStruct(u'ProductName', u'Minecraft Mod Dependency Check'), #产品名称
StringStruct(u'ProductVersion', u'1.0.0')]) #产品版本
]
),
VarFileInfo([VarStruct(u'Translation', [2052, 1200])]) # 语言
]
)

0 comments on commit 1decc06

Please sign in to comment.