Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

README.md 1.5 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Python scripts for FPSMS backend
  2. This folder holds Python programs that integrate with the FPSMS backend (e.g. calling the public `/py` API).
  3. ## Setup
  4. ```bash
  5. cd python
  6. pip install -r requirements.txt
  7. ```
  8. ## Configuration
  9. Set the backend base URL (optional, default below):
  10. - Environment: `FPSMS_BASE_URL` (default: `http://localhost:8090/api` — includes context path `/api`)
  11. - Or edit the default in each script.
  12. ## Scripts
  13. | Script | Description |
  14. |--------|-------------|
  15. | `Bag1.py` | **GUI**: date selector (default today) and job orders as buttons; click shows "Clicked on Job Order code XXXX item xxxx". Run: `python Bag1.py` |
  16. | `fetch_job_orders.py` | CLI: fetches job orders by plan date from `GET /py/job-orders` |
  17. ## Building Bag1 as a standalone .exe
  18. To distribute Bag1 to customer PCs **without giving them source code or requiring Python**:
  19. 1. On your development PC (with Python installed), open a terminal in the `python` folder.
  20. 2. Install build dependencies:
  21. ```bash
  22. pip install -r requirements-build.txt
  23. ```
  24. 3. Run the build script:
  25. ```bash
  26. build_exe.bat
  27. ```
  28. Or run PyInstaller directly:
  29. ```bash
  30. pyinstaller --onefile --windowed --name Bag1 Bag1.py
  31. ```
  32. 4. The executable is created at `dist\Bag1.exe`. Copy **only** `Bag1.exe` to the customer computer and run it; no Python or source code is needed. The app will save its settings (`bag1_settings.json`) in the same folder as the exe.
  33. ## Adding new scripts
  34. Add new `.py` files here and list them in this README. Use `requirements.txt` for any new dependencies.