修改原本程序结构,新增命令逻辑
This commit is contained in:
8
windows/command/Download.py
Normal file
8
windows/command/Download.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import jmcomic as jm
|
||||
import os, sys
|
||||
|
||||
print(f'请输入 jmcomic 车号')
|
||||
|
||||
car_id = input()
|
||||
|
||||
jm.download_album(car_id)
|
||||
2
windows/command/help.py
Normal file
2
windows/command/help.py
Normal file
@@ -0,0 +1,2 @@
|
||||
print("jm", "{:12}选择你需要下载的漫画".format(" "))
|
||||
print("version", "{:7}查看当前版本".format(" "))
|
||||
2
windows/command/version.py
Normal file
2
windows/command/version.py
Normal file
@@ -0,0 +1,2 @@
|
||||
print("jm_download_python")
|
||||
print("2026-02-04", "(v0.02)")
|
||||
23
windows/main.py
Normal file
23
windows/main.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import sys, os, subprocess
|
||||
from pathlib import Path
|
||||
|
||||
# 设定使用的python环境
|
||||
venv_python = Path(r"./venv/Scripts/python.exe")
|
||||
|
||||
|
||||
# 设定
|
||||
if len(sys.argv) == 1:
|
||||
# 如果什么都没输入就输出
|
||||
subprocess.run([str(venv_python),".\\command\\help.py"], check=True)
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
command = sys.argv[1]
|
||||
|
||||
if command == "help":
|
||||
subprocess.run([str(venv_python),".\\command\\help.py"], check=True)
|
||||
elif command == "jm":
|
||||
subprocess.run([str(venv_python),".\\command\\Download.py"], check=True)
|
||||
elif command == "version":
|
||||
subprocess.run([str(venv_python),".\\command\\version.py"], check=True)
|
||||
else:
|
||||
print(f"未知的命令: {command}")
|
||||
Reference in New Issue
Block a user