chore: 初始化项目结构
This commit is contained in:
commit
9bbd7fc63f
42
.gitignore
vendored
Normal file
42
.gitignore
vendored
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# Python
|
||||||
|
python/.venv/
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
*.so
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
|
||||||
|
# Node
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
|
||||||
|
# OS
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Electron
|
||||||
|
dist/
|
||||||
|
out/
|
||||||
13
package.json
Normal file
13
package.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "excel-batch-editor",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Electron desktop app for bulk editing Excel files",
|
||||||
|
"main": "electron/main.js",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "electron .",
|
||||||
|
"build": "electron-builder"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {}
|
||||||
|
}
|
||||||
1
python/generator.py
Normal file
1
python/generator.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# placeholder
|
||||||
25
python/main.py
Normal file
25
python/main.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import sys
|
||||||
|
import json
|
||||||
|
|
||||||
|
def main():
|
||||||
|
for line in sys.stdin:
|
||||||
|
line = line.strip()
|
||||||
|
if not line:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
req = json.loads(line)
|
||||||
|
action = req.get("action")
|
||||||
|
if action == "parse_template":
|
||||||
|
from parser import parse_template
|
||||||
|
result = parse_template(req["file_path"])
|
||||||
|
elif action == "generate":
|
||||||
|
from generator import generate
|
||||||
|
result = generate(req)
|
||||||
|
else:
|
||||||
|
result = {"error": f"unknown action: {action}"}
|
||||||
|
except Exception as e:
|
||||||
|
result = {"error": str(e)}
|
||||||
|
print(json.dumps(result, ensure_ascii=False), flush=True)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
1
python/parser.py
Normal file
1
python/parser.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# placeholder
|
||||||
3
python/requirements.txt
Normal file
3
python/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
openpyxl==3.1.2
|
||||||
|
Pillow==10.3.0
|
||||||
|
pytest==8.2.0
|
||||||
0
tests/python/__init__.py
Normal file
0
tests/python/__init__.py
Normal file
1
tests/python/test_generator.py
Normal file
1
tests/python/test_generator.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# placeholder
|
||||||
1
tests/python/test_parser.py
Normal file
1
tests/python/test_parser.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# placeholder
|
||||||
Loading…
x
Reference in New Issue
Block a user