Skip to content

Commit 714b100

Browse files
committed
input/default/generate.py: new python-based generate script
update generate.sh for 0.3a3 syntax with new output modes and dmrconfig template
1 parent 07ba5cd commit 714b100

File tree

3 files changed

+65
-5
lines changed

3 files changed

+65
-5
lines changed

input/default/example-d878uv.conf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# mycodeplug/example-codeplug generated $ISODATE
3+
# by dzcb (https://github.com/mycodeplug/dzcb)
4+
#
5+
# !dzcb.ranges: 136-174,400-480
6+
Radio: Anytone AT-D878UV
7+
8+
# Table of text messages.
9+
# 1) Message number: 1-100
10+
# 2) Text: up to 200 characters
11+
#
12+
Message Text
13+
1 Hello
14+
2 Thank you
15+
3 73
16+
4 QTH?
17+
5 Test message
18+
19+
# Unique DMR ID and name of this radio.
20+
ID: 12345678
21+
Name: AA1AA
22+
23+
# Text displayed when the radio powers up.
24+
Intro Line 1: $DATE
25+
Intro Line 2: PNWDigital

input/default/generate.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python3
2+
3+
# This generates the same codeplug as generate.sh
4+
# using python code.
5+
6+
from pathlib import Path
7+
import os
8+
9+
from dzcb.recipe import CodeplugRecipe
10+
11+
cp_dir = Path(__file__).parent
12+
output = Path(os.environ.get("OUTPUT") or (cp_dir / ".." / ".." / "OUTPUT"))
13+
14+
CodeplugRecipe(
15+
source_pnwdigital=True,
16+
source_seattledmr=True,
17+
source_default_k7abd=True,
18+
source_k7abd=[(cp_dir / "k7abd")],
19+
source_repeaterbook_proximity=cp_dir / "prox.csv",
20+
repeaterbook_states=["washington", "oregon"],
21+
scanlists_json=cp_dir / "scanlists.json",
22+
exclude=cp_dir / "exclude.csv",
23+
order=cp_dir / "order.csv",
24+
replacements=cp_dir / "replacements.csv",
25+
output_anytone=True,
26+
output_dmrconfig=[(cp_dir / "example-d878uv.conf")],
27+
output_farnsworth=[(cp_dir / "example-md-uv380.json")],
28+
output_gb3gf=True
29+
).generate(output / cp_dir.name)

input/default/generate.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
#!/usr/bin/env bash
22

3+
# This generates the same codeplug as generate.py
4+
# using bash scripting. Linux or macOS only.
5+
36
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
47
OUTPUT=${OUTPUT:-$DIR/../../OUTPUT}
58
python -m dzcb \
69
--pnwdigital \
710
--seattledmr \
811
--default-k7abd \
9-
--repeaterbook-state washington oregon \
10-
--repeaterbook-proximity-csv "$DIR/prox.csv" \
1112
--k7abd $DIR/k7abd \
12-
--farnsworth-template-json "$DIR/example-md-uv380.json" \
13-
--order "$DIR/order.csv" \
13+
--repeaterbook-proximity-csv "$DIR/prox.csv" \
14+
--repeaterbook-state washington oregon \
15+
--scanlists-json "$DIR/scanlists.json" \
1416
--exclude "$DIR/exclude.csv" \
17+
--order "$DIR/order.csv" \
1518
--replacements "$DIR/replacements.csv" \
16-
--scanlists-json "$DIR/scanlists.json" \
19+
--anytone \
20+
--dmrconfig "$DIR/example-d878uv.conf" \
21+
--farnsworth-template-json "$DIR/example-md-uv380.json" \
22+
--gb3gf \
1723
-- "$OUTPUT/$(basename "$DIR")"

0 commit comments

Comments
 (0)