diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0d08e26..4e7559d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,7 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/pack.iss b/pack.iss index b9e4ac7..ebd1be2 100644 --- a/pack.iss +++ b/pack.iss @@ -1,7 +1,7 @@ [Setup] AppName=芙芙工具箱开发工具包 -AppVersion=2024.11.27.2000 -VersionInfoVersion=2024.11.27.2000 +AppVersion=2025.01.02.2300 +VersionInfoVersion=2025.01.02.2300 AppPublisher=DuckStudio VersionInfoCopyright=Copyright (c) 鸭鸭「カモ」 AppPublisherURL=https://duckduckstudio.github.io/yazicbs.github.io/ @@ -9,7 +9,7 @@ DefaultDirName={autopf}\Fufu_Dev_Tools DefaultGroupName=芙芙工具箱开发工具包 UninstallDisplayIcon={app}\Script\ffdev.exe OutputDir=构建文件 -OutputBaseFilename=Fufu_Dev_Tools_Setup_2024.11.27.2000 +OutputBaseFilename=Fufu_Dev_Tools_Setup_2025.01.02.2300 SetupIconFile=Fufu_Tools\ico.ico LicenseFile=LICENSE-GBK Compression=lzma2 diff --git a/requirements.txt b/requirements.txt index 588e7f3..be1189c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -colorama -configparser -plyer -chardet +colorama==0.4.6 +configparser==7.1.0 +plyer==2.1.0 +chardet==5.2.0 diff --git "a/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/Script/ffdev.py" "b/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/Script/ffdev.py" index ce20aca..251de63 100644 --- "a/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/Script/ffdev.py" +++ "b/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/Script/ffdev.py" @@ -3,7 +3,7 @@ from colorama import init, Fore init(autoreset=True) -version = "2024.11.27.2000" +version = "2025.01.02.2300" def main(): if len(sys.argv) < 2: @@ -20,12 +20,14 @@ def main(): "参数查重": "代码校对/参数查重.exe", "非UTF-8编码": "代码校对/非UTF-8编码.exe", "尾随空格": "代码校对/尾随空格.exe", + "末尾空行": "代码校对/末尾空行.exe", "需求生成": "生成工具/需求生成.exe", "代码行数": "统计/代码总行数.exe", "账号切换": "git/账号切换.exe", "连续push": "git/连续push尝试.exe", "连续pull": "git/连续pull尝试.exe", - "git连续尝试": "git/git连续尝试.exe" + "git连续尝试": "git/git连续尝试.exe", + "目录复制": "目录复制.exe" } if program in ["ver", "版本", "version", "Version", "--version", "--ver", "-v"]: diff --git "a/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/\344\273\243\347\240\201\346\240\241\345\257\271/\346\234\253\345\260\276\347\251\272\350\241\214.py" "b/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/\344\273\243\347\240\201\346\240\241\345\257\271/\346\234\253\345\260\276\347\251\272\350\241\214.py" index 655516c..46fa187 100644 --- "a/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/\344\273\243\347\240\201\346\240\241\345\257\271/\346\234\253\345\260\276\347\251\272\350\241\214.py" +++ "b/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/\344\273\243\347\240\201\346\240\241\345\257\271/\346\234\253\345\260\276\347\251\272\350\241\214.py" @@ -15,8 +15,12 @@ def check_files(directory): with open(filepath, 'rb') as file: rawdata = file.read() # 使用 chardet 库自动检测文件编码 - result = chardet.detect(rawdata) - encoding = result['encoding'] + try: + result = chardet.detect(rawdata) + encoding = result['encoding'] + except Exception as e: + encoding = "utf-8" + print(f"{Fore.YELLOW}⚠{Fore.RESET} 无法检测文件 {Fore.BLUE}{filepath}{Fore.RESET} 的编码,将默认使用 UTF-8\n{Fore.YELLOW}⚠{Fore.RESET} {Fore.RED}{e}{Fore.RESET}") with open(filepath, 'r', encoding=encoding) as decoded_file: for line in decoded_file: last_line = line diff --git "a/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/\346\200\273\350\260\203\347\224\250.py" "b/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/\346\200\273\350\260\203\347\224\250.py" deleted file mode 100644 index 6f6492b..0000000 --- "a/\345\274\200\345\217\221\345\267\245\345\205\267-\346\211\223\345\214\205/\346\200\273\350\260\203\347\224\250.py" +++ /dev/null @@ -1,81 +0,0 @@ -import os -import sys -import configparser -import subprocess -from colorama import init, Fore - -# ------ 初始化 -------- -init(autoreset=True) -os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) -config = configparser.ConfigParser() -config.read('config.ini') -check_directory = input("请输入目录:") -# 验证 -if check_directory.startswith(("'", '"')) and check_directory.endswith(("'", '"')): - check_directory = check_directory[1:-1] - -if not check_directory.endswith('\\'): - check_directory += '\\' - -if not os.path.exists(check_directory): - print("指定的目录路径不存在,请重新运行程序并输入有效的目录路径。") - input("按 ENTER 键继续...") - sys.exit(1) -# ---------------------- - -# --------- 构建调用命令函数 ----------- -def build_Check_the_trailing_space_call_command(directory): - """ - usage: 尾随空格.py [-h] [--file_extensions FILE_EXTENSIONS] --dir DIRECTORY - - 检查指定目录下的文件是否存在尾随空格 - - options: - -h, --help show this help message and exit - --file_extensions FILE_EXTENSIONS 要检查的文件扩展名列表,以 , 分隔 - --dir DIRECTORY 要检查的目录路径 - """ - file_extensions = config.get('Check_trailing_space', 'FileExtensions') - - if isinstance(file_extensions, list): - file_extensions = ','.join(file_extensions) - - command = f'python 代码校对\\尾随空格.py --dir {directory}' - if file_extensions: - command += f' --file_extensions {file_extensions}' - - subprocess.run(command, shell=True) - -def build_Check_encoding_command(directory): - """ - usage: 尾随空格.py [-h] [--file_extensions FILE_EXTENSIONS] --dir DIRECTORY - - 检查指定目录下的文件是否存在尾随空格 - - options: - -h, --help show this help message and exit - --file_extensions FILE_EXTENSIONS 要检查的文件扩展名列表,以 , 分隔 - --dir DIRECTORY 要检查的目录路径 - """ - file_extensions = config.get('Check_trailing_space', 'FileExtensions') - - if isinstance(file_extensions, list): - file_extensions = ','.join(file_extensions) - - command = f'python 代码校对\\非UTF-8编码.py --dir {directory}' - if file_extensions: - command += f' --file_extensions {file_extensions}' - - subprocess.run(command, shell=True) -# --------------------------------------------------- - -# -------- 调用构建函数 ----------- -print("Tip:如果你看到持续一段时间没有输出可能不是卡住了,而是文件太多还没检查完,过会再看看?") -print("如果你认为确实存在异常请提交Issues。") -print(Fore.GREEN + "开始执行代码校对") -build_Check_the_trailing_space_call_command(check_directory)# 执行 代码校对\尾随空格 检查 -build_Check_encoding_command(check_directory)# 执行 代码校对\非UTF-8编码 检查 -print(f"{Fore.GREEN}✓{Fore.RESET} 代码校对完成!") -# -------------------------------- - -input("按 Enter 键退出...") diff --git "a/\345\274\200\345\217\221\345\267\245\345\205\267-\346\272\220\347\240\201/Script/ffdev.ps1" "b/\345\274\200\345\217\221\345\267\245\345\205\267-\346\272\220\347\240\201/Script/ffdev.ps1" index 570b5f4..e20ee77 100644 --- "a/\345\274\200\345\217\221\345\267\245\345\205\267-\346\272\220\347\240\201/Script/ffdev.ps1" +++ "b/\345\274\200\345\217\221\345\267\245\345\205\267-\346\272\220\347\240\201/Script/ffdev.ps1" @@ -1,36 +1,38 @@ param( - [string]$program, - [string]$command, - [string[]]$inputArgs + [string]$tool, + [Parameter(ValueFromRemainingArguments=$true)] + [string[]]$Args ) $parentDir = Split-Path -Path $PSScriptRoot -Parent -$version = "2024.11.27.2000" +$version = "2025.01.02.2300" $flag = 0 -if ($program -eq "总调用") { +if ($tool -eq "总调用") { $pythonScript = Join-Path $parentDir "总调用.py" -} elseif ($program -eq "目录复制") { - $pythonScript = Join-Path $parentDir "目录复制.py" -} elseif ($program -eq "参数查重") { +} elseif ($tool -eq "目录复制") { + $pythonScript = Join-Path $parentDir "目录复制.pyw" +} elseif ($tool -eq "参数查重") { $pythonScript = Join-Path $parentDir "代码校对\参数查重.py" -} elseif ($program -eq "非UTF-8编码") { +} elseif ($tool -eq "非UTF-8编码") { $pythonScript = Join-Path $parentDir "代码校对\非UTF-8编码.py" -} elseif ($program -eq "尾随空格") { +} elseif ($tool -eq "尾随空格") { $pythonScript = Join-Path $parentDir "代码校对\尾随空格.py" -} elseif ($program -eq "需求生成") { +} elseif ($tool -eq "末尾空行") { + $pythonScript = Join-Path $parentDir "代码校对\末尾空行.py" +} elseif ($tool -eq "需求生成") { $pythonScript = Join-Path $parentDir "生成工具\需求生成.py" -} elseif ($program -eq "代码行数") { +} elseif ($tool -eq "代码行数") { $pythonScript = Join-Path $parentDir "统计\代码总行数.py" -} elseif ($program -eq "账号切换") { +} elseif ($tool -eq "账号切换") { $pythonScript = Join-Path $parentDir "git\账号切换.py" -} elseif ($program -eq "连续push") { +} elseif ($tool -eq "连续push") { $pythonScript = Join-Path $parentDir "git\连续push尝试.py" -} elseif ($program -eq "连续pull") { +} elseif ($tool -eq "连续pull") { $pythonScript = Join-Path $parentDir "git\连续pull尝试.py" -} elseif ($program -eq "git连续尝试") { +} elseif ($tool -eq "git连续尝试") { $pythonScript = Join-Path $parentDir "git\git连续尝试.py" -} elseif ($program -in "ver", "版本", "version", "Version", "--version", "--ver", "-v") { +} elseif ($tool -in "ver", "版本", "version", "Version", "--version", "--ver", "-v") { Write-Output "版本: $version" Write-Output "安装在: $parentDir" $flag = 1 @@ -41,5 +43,5 @@ if ($program -eq "总调用") { } if ($flag -ne 1) { - python $pythonScript $command $inputArgs + python $pythonScript $Args }