diff --git a/样式大小调整.zip b/Delphi10/开发档案/皮肤样式/Bpl.zip similarity index 99% rename from 样式大小调整.zip rename to Delphi10/开发档案/皮肤样式/Bpl.zip index e91b276..d4d6bf2 100644 Binary files a/样式大小调整.zip and b/Delphi10/开发档案/皮肤样式/Bpl.zip differ diff --git a/Delphi10/开发档案/皮肤样式/skin.py b/Delphi10/开发档案/皮肤样式/skin.py new file mode 100644 index 0000000..7fa4b7f --- /dev/null +++ b/Delphi10/开发档案/皮肤样式/skin.py @@ -0,0 +1,114 @@ +import os +import logging + +# 设置日志记录 +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + +# 定义替换列表 +replacements = [ + ('dxSkinsCore,', ''), + ('dxSkinsDefaultPainters,', ''), + ('dxSkinWXI,', ''), + ('dxSkinBasic,', ''), + ('dxSkinBlack,', ''), + ('dxSkinBlue,', ''), + ('dxSkinBlueprint,', ''), + ('dxSkinCaramel,', ''), + ('dxSkinCoffee,', ''), + ('dxSkinDarkroom,', ''), + ('dxSkinDarkSide,', ''), + ('dxSkinDevExpressDarkStyle,', ''), + ('dxSkinDevExpressStyle,', ''), + ('dxSkinFoggy,', ''), + ('dxSkinGlassOceans,', ''), + ('dxSkinHighContrast,', ''), + ('dxSkiniMaginary,', ''), + ('dxSkinLilian,', ''), + ('dxSkinLiquidSky,', ''), + ('dxSkinLondonLiquidSky,', ''), + ('dxSkinMcSkin,', ''), + ('dxSkinMetropolis,', ''), + ('dxSkinMetropolisDark,', ''), + ('dxSkinMoneyTwins,', ''), + ('dxSkinOffice2007Black,', ''), + ('dxSkinOffice2007Blue,', ''), + ('dxSkinOffice2007Green,', ''), + ('dxSkinOffice2007Pink,', ''), + ('dxSkinOffice2007Silver,', ''), + ('dxSkinOffice2010Black,', ''), + ('dxSkinOffice2010Blue,', ''), + ('dxSkinOffice2010Silver,', ''), + ('dxSkinOffice2013DarkGray,', ''), + ('dxSkinOffice2013LightGray,', ''), + ('dxSkinOffice2013White,', ''), + ('dxSkinOffice2016Colorful,', ''), + ('dxSkinOffice2016Dark,', ''), + ('dxSkinOffice2019Black,', ''), + ('dxSkinOffice2019Colorful,', ''), + ('dxSkinOffice2019DarkGray,', ''), + ('dxSkinOffice2019White,', ''), + ('dxSkinPumpkin,', ''), + ('dxSkinSeven,', ''), + ('dxSkinSevenClassic,', ''), + ('dxSkinSharp,', ''), + ('dxSkinSharpPlus,', ''), + ('dxSkinSilver,', ''), + ('dxSkinSpringtime,', ''), + ('dxSkinStardust,', ''), + ('dxSkinSummer2008,', ''), + ('dxSkinTheAsphaltWorld,', ''), + ('dxSkinTheBezier,', ''), + ('dxSkinValentine,', ''), + ('dxSkinVisualStudio2013Blue,', ''), + ('dxSkinVisualStudio2013Dark,', ''), + ('dxSkinVisualStudio2013Light,', ''), + ('dxSkinVS2010,', ''), + ('dxSkinWhiteprint,', ''), + ('dxSkinXmas2008Blue,', ''), + ('dxSkinXmas2008Blue;', ';') +] + + +def replace_in_file(file_path, replacements, encodings=['utf-8', 'gbk']): + temp_file_path = file_path + '.tmp' + try: + # 尝试使用提供的编码列表打开文件 + for encoding in encodings: + try: + with open(file_path, 'r', encoding=encoding) as infile, \ + open(temp_file_path, 'w', encoding=encoding) as outfile: + # 读取整个文件内容到一个字符串中 + file_content = infile.read() + # 对文件内容进行所有替换操作 + for old, new in replacements: + file_content = file_content.replace(old, new) + # 将替换后的内容写回临时文件 + outfile.write(file_content) + # 使用os.replace原子性地替换原文件 + os.replace(temp_file_path, file_path) + logging.info(f"Successfully processed file: {file_path} using encoding {encoding}") + break # 成功处理后跳出循环 + except UnicodeDecodeError: + # 如果当前编码失败,则尝试下一个编码 + logging.warning(f"Failed to decode file {file_path} using encoding {encoding}") + else: + # 如果所有编码都失败,则记录错误并删除临时文件(如果存在) + logging.error(f"Failed to process file {file_path} with all provided encodings") + if os.path.exists(temp_file_path): + os.remove(temp_file_path) + except Exception as e: + logging.error(f"Error processing file {file_path}: {e}") + if os.path.exists(temp_file_path): + os.remove(temp_file_path) + + +def replace_in_folder(folder_path, replacements, encodings=['utf-8', 'gbk']): + for root, dirs, files in os.walk(folder_path): + for file_name in files: + if file_name.endswith('.pas'): + file_path = os.path.join(root, file_name) + replace_in_file(file_path, replacements, encodings) + + +# 执行替换操作 +replace_in_folder(r'D:\Dp10Repo\项目代码\D10gmXinde', replacements) \ No newline at end of file diff --git a/Delphi10/开发档案/皮肤样式/操作说明.txt b/Delphi10/开发档案/皮肤样式/操作说明.txt new file mode 100644 index 0000000..065248c --- /dev/null +++ b/Delphi10/开发档案/皮肤样式/操作说明.txt @@ -0,0 +1,7 @@ +C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl + +备份上述文件夹后替换整个文件夹 + +移除 所有.pas文件中的 dxskin 开开头的引用 + +可使用python脚本批量操作 操作前请备份好文件 \ No newline at end of file diff --git a/AllSkins.skinres b/Delphi10/系统文件/客户终端/AllSkins.skinres similarity index 100% rename from AllSkins.skinres rename to Delphi10/系统文件/客户终端/AllSkins.skinres diff --git a/FileUpdate.dll b/Delphi10/系统文件/客户终端/FileUpdate.dll similarity index 100% rename from FileUpdate.dll rename to Delphi10/系统文件/客户终端/FileUpdate.dll diff --git a/PdfPrint.dll b/Delphi10/系统文件/客户终端/PdfPrint.dll similarity index 100% rename from PdfPrint.dll rename to Delphi10/系统文件/客户终端/PdfPrint.dll diff --git a/RightSoft.exe b/Delphi10/系统文件/客户终端/RightSoft.exe similarity index 100% rename from RightSoft.exe rename to Delphi10/系统文件/客户终端/RightSoft.exe diff --git a/RtDesign.dll b/Delphi10/系统文件/客户终端/RtDesign.dll similarity index 100% rename from RtDesign.dll rename to Delphi10/系统文件/客户终端/RtDesign.dll diff --git a/RtSoftMainUpdate.exe b/Delphi10/系统文件/客户终端/RtSoftMainUpdate.exe similarity index 100% rename from RtSoftMainUpdate.exe rename to Delphi10/系统文件/客户终端/RtSoftMainUpdate.exe diff --git a/SysModuleSet.dll b/Delphi10/系统文件/客户终端/SysModuleSet.dll similarity index 100% rename from SysModuleSet.dll rename to Delphi10/系统文件/客户终端/SysModuleSet.dll diff --git a/firstPage.dll b/Delphi10/系统文件/客户终端/firstPage.dll similarity index 100% rename from firstPage.dll rename to Delphi10/系统文件/客户终端/firstPage.dll diff --git a/rtCommon.dll b/Delphi10/系统文件/客户终端/rtCommon.dll similarity index 100% rename from rtCommon.dll rename to Delphi10/系统文件/客户终端/rtCommon.dll diff --git a/sybase.dll b/Delphi10/系统文件/客户终端/sybase.dll similarity index 100% rename from sybase.dll rename to Delphi10/系统文件/客户终端/sybase.dll diff --git a/FileKPZ(RollMakingShop).INI b/Delphi10/系统文件/检验终端/FileKPZ(RollMakingShop).INI similarity index 100% rename from FileKPZ(RollMakingShop).INI rename to Delphi10/系统文件/检验终端/FileKPZ(RollMakingShop).INI diff --git a/RollMakingShop.exe b/Delphi10/系统文件/检验终端/RollMakingShop.exe similarity index 100% rename from RollMakingShop.exe rename to Delphi10/系统文件/检验终端/RollMakingShop.exe