updated the config files to a tempalte/local standard format

This commit is contained in:
2026-08-18 13:53:28 -05:00
parent 07472711e7
commit 5e0fbdbf70
11 changed files with 42 additions and 4 deletions

7
.gitignore vendored
View File

@@ -1 +1,8 @@
references/
# Per-machine working config (created from config.template.ini on first run)
config.ini
# Python bytecode cache
__pycache__/
*.pyc

View File

@@ -13,7 +13,8 @@ Extracts and organizes documents from FileCabinet CS (Thomson Reuters) using GUI
| File | Purpose |
|------|---------|
| `config.ini` | All paths, timeouts, and FCCS control identifiers |
| `config.template.ini` | Tracked template for all paths, timeouts, and FCCS control identifiers |
| `config.ini` | Per-machine working config (git-ignored; auto-created from the template) |
| `fccs_folders.txt` | FCCS folder templates (manually populated per engagement) |
| `fccs_config.py` | Shared config loading, logging, folder pattern building |
| `fccs_scan.py` | Step 1: Scan backup directory for drawer IDs |
@@ -26,7 +27,7 @@ Extracts and organizes documents from FileCabinet CS (Thomson Reuters) using GUI
## Setup Per Engagement
1. Edit `config.ini` -- point `backup_dir`, `export_dir`, and `output_dir` at the client's directories.
1. Edit `config.ini` -- point `backup_dir`, `export_dir`, and `output_dir` at the client's directories. This file is created automatically from `config.template.ini` the first time you run any script (it's git-ignored, so your machine-specific paths never drift the repo). To reset a machine, delete `config.ini` and re-run. Keep shared/default changes in `config.template.ini` (the tracked file).
2. Populate `fccs_folders.txt` -- open FCCS > System Configuration > Document Folders and list each folder template exactly as shown, one per line. Keep the `YYYY` prefix on recurring folders. UltraTax CS folders are detected automatically and do not need to be listed.
## Workflow
@@ -134,7 +135,7 @@ Any outstanding drawer that also appears in `crashed.txt` (its export was aborte
## Config Reference
All scripts read from `config.ini` (or specify `--config path\to\config.ini`).
All scripts read from `config.ini` (or specify `--config path\to\config.ini`). `config.ini` is the git-ignored, per-machine copy auto-created from the tracked `config.template.ini`; edit `config.ini` locally.
- **`[paths]`** -- backup_dir, export_dir, output_dir, drawer_id_file, completed_file, ignore_file, crashed_file, log_file, verify_report, report_html, screenshot_dir, manifest_dir, folder_list
- **`[timeouts]`** -- nav_timeout, dialog_timeout, progress_appear, progress_finish, settle, confirm_timeout

View File

@@ -1,3 +1,12 @@
# ---------------------------------------------------------------------------
# TEMPLATE CONFIG — tracked in git. Do NOT edit for a specific machine.
#
# On first run the scripts copy this file to `config.ini` (which is git-ignored)
# and use that. Edit `config.ini` for this machine's paths/settings so your
# local changes never drift the repo. To reset a machine, delete `config.ini`
# and re-run; it will be recreated from this template.
# ---------------------------------------------------------------------------
[paths]
# Point these at the current engagement's directories
backup_dir = C:\Migration\Backups

View File

@@ -5,11 +5,13 @@ Shared configuration, logging, and utilities for the FCCS extraction tool.
import os
import re
import sys
import shutil
import argparse
import configparser
from datetime import datetime
DEFAULT_CONFIG = "config.ini"
TEMPLATE_CONFIG = "config.template.ini"
def parse_args():
@@ -24,12 +26,31 @@ def parse_args():
def load_config(path=None):
"""Read config.ini and return a ConfigParser object."""
"""Read the config file and return a ConfigParser object.
Config is split into two files:
- config.template.ini : tracked in git, the pristine template.
- config.ini : git-ignored, this machine's working copy.
When no explicit --config path is given, the per-machine config.ini is used.
If it doesn't exist yet, it's created from config.template.ini so a freshly
cloned/pulled repo works out of the box without editing the tracked file.
Edit config.ini locally; your changes never drift the repo.
"""
if path is None:
script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
path = os.path.join(script_dir, DEFAULT_CONFIG)
# Auto-create the per-machine config from the template on first run.
if not os.path.exists(path):
template = os.path.join(script_dir, TEMPLATE_CONFIG)
if os.path.exists(template):
shutil.copyfile(template, path)
print(f"Created {DEFAULT_CONFIG} from {TEMPLATE_CONFIG}. "
f"Edit it for this machine's settings: {path}")
if not os.path.exists(path):
print(f"ERROR: config file not found: {path}")
print(f" Expected {DEFAULT_CONFIG} or a --config path "
f"(template: {TEMPLATE_CONFIG}).")
sys.exit(1)
cfg = configparser.ConfigParser()
cfg.read(path, encoding="utf-8")