rename battleflow to encounterflow #2

Merged
parkel merged 1 commits from rename-encounterflow into main 2025-11-20 16:55:48 +01:00
35 changed files with 22 additions and 22 deletions
Showing only changes of commit f1325f31e0 - Show all commits

View File

@@ -15,7 +15,7 @@ dev:
$(PY) -m pip install -r requirements-dev.txt
run:
$(PY) -m battleflow.cli --host $(HOST) --port $(PORT) --token $(TOKEN) $(if $(DATA),--data-dir $(DATA),)
$(PY) -m encounterflow.cli --host $(HOST) --port $(PORT) --token $(TOKEN) $(if $(DATA),--data-dir $(DATA),)
test:
pytest -q

View File

@@ -5,16 +5,16 @@ Refactored project layout (same features, cleaner code).
## Install & Run
```bash
pip install -e .
battleflow --host 0.0.0.0 --port 5050 --token YOURSECRET
encounterflow --host 0.0.0.0 --port 5050 --token YOURSECRET
```
Open:
- Admin: `http://HOST:PORT/admin?token=YOURSECRET`
- Board: `http://HOST:PORT/board?token=YOURSECRET`
## Data directories
Default data folder is `battleflow_data/`. If an older `initrack_data/` exists and `battleflow_data/` isn't present, it will be reused automatically (migration-by-reuse).
Default data folder is `encounterflow_data/`. If an older `initrack_data/` exists and `encounterflow_data/` isn't present, it will be reused automatically (migration-by-reuse).
```
battleflow_data/
encounterflow_data/
avatars/
icons/
state.json

View File

@@ -5,11 +5,11 @@ from .storage import ensure_default_icons, load_state
from .state import STATE
def main():
parser = argparse.ArgumentParser(prog="battleflow")
parser = argparse.ArgumentParser(prog="encounterflow")
parser.add_argument('--host', default='127.0.0.1')
parser.add_argument('--port', type=int, default=5050)
parser.add_argument('--token', default=os.environ.get('BATTLEFLOW_TOKEN','changeme'))
parser.add_argument('--data-dir', default=os.environ.get('BATTLEFLOW_DATA_DIR'))
parser.add_argument('--token', default=os.environ.get('ENCOUNTERFLOW_TOKEN','changeme'))
parser.add_argument('--data-dir', default=os.environ.get('ENCOUNTERFLOW_DATA_DIR'))
args = parser.parse_args()
app = create_app(token=args.token, data_dir=args.data_dir)

View File

@@ -1,17 +1,17 @@
# battleflow/config.py
# encounterflow/config.py
import os
DEFAULT_DATA_DIR = os.path.join(os.getcwd(), "battleflow_data")
DEFAULT_DATA_DIR = os.path.join(os.getcwd(), "encounterflow_data")
def load_config(app, **overrides):
app.config.setdefault("SECRET_KEY", os.environ.get("SECRET_KEY", "dev-secret"))
app.config.setdefault(
"COMBAT_TOKEN",
overrides.get("token") or os.environ.get("BATTLEFLOW_TOKEN", "changeme")
overrides.get("token") or os.environ.get("ENCOUNTERFLOW_TOKEN", "changeme")
)
# Kies data-dir: override/env > default. Migreer legacy 'initrack_data' → 'battleflow_data' indien nodig.
data_dir = overrides.get("data_dir") or os.environ.get("BATTLEFLOW_DATA_DIR")
# Kies data-dir: override/env > default. Migreer legacy 'initrack_data' → 'encounterflow_data' indien nodig.
data_dir = overrides.get("data_dir") or os.environ.get("ENCOUNTERFLOW_DATA_DIR")
if not data_dir:
default_new = DEFAULT_DATA_DIR
legacy = os.path.join(os.getcwd(), "initrack_data")
@@ -32,7 +32,7 @@ def load_config(app, **overrides):
os.makedirs(app.config["ICON_DIR"], exist_ok=True)
# Branding
app.config.setdefault("PRODUCT_NAME", "Battleflow")
app.config.setdefault("PRODUCT_NAME", "EncounterFlow")
app.config.setdefault("PRODUCT_SUBTITLE", "by Aetryos Workshop")
return app

View File

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 241 B

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 533 B

After

Width:  |  Height:  |  Size: 533 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 567 B

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -3,9 +3,9 @@ requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "battleflow"
name = "encounterflow"
version = "0.1.0"
description = "Battleflow — OBS-friendly initiative board for tabletop encounters"
description = "EncounterFlow"
authors = [{name="Aetryos Workshop"}]
requires-python = ">=3.9"
dependencies = [
@@ -14,4 +14,4 @@ dependencies = [
]
[project.scripts]
battleflow = "battleflow.cli:main"
encounterflow = "encounterflow.cli:main"

View File

@@ -9,7 +9,7 @@ def install(c):
@task
def run(c, host="0.0.0.0", port=5050, token="changeme", data_dir=""):
extra = f"--data-dir {data_dir}" if data_dir else ""
c.run(f"python -m battleflow.cli --host {host} --port {port} --token {token} {extra}")
c.run(f"python -m encounterflow.cli --host {host} --port {port} --token {token} {extra}")
@task
def seed_icons(c, host="127.0.0.1", port=5050, token="changeme"):

View File

@@ -1,8 +1,8 @@
import os, json, tempfile, shutil
import pytest
from battleflow import create_app
from battleflow.state import STATE
from battleflow.storage import ensure_default_icons, load_state
from encounterflow import create_app
from encounterflow.state import STATE
from encounterflow.storage import ensure_default_icons, load_state
TOKEN = "testtoken"
@@ -11,8 +11,8 @@ def isolated_data(tmp_path, monkeypatch):
# fresh state for each test
data_dir = tmp_path / "bfdata"
data_dir.mkdir()
monkeypatch.setenv("BATTLEFLOW_DATA_DIR", str(data_dir))
monkeypatch.setenv("BATTLEFLOW_TOKEN", TOKEN)
monkeypatch.setenv("ENCOUNTERFLOW_DATA_DIR", str(data_dir))
monkeypatch.setenv("ENCOUNTERFLOW_TOKEN", TOKEN)
# reset STATE
STATE.actors.clear(); STATE.turn_idx=0; STATE.round=1; STATE.visible=True; STATE.dead_mode='normal'
app = create_app()