net-sim: bundle the MCC/MNC list and hide MVNOs from the picker (v2.7.7)
The operator picker depended on a workspace file outside the repo
(<workspace>/samples/mcc-mnc-list.json), so a fresh clone showed
'Operator list not loaded'.
- bundle the list in the package (pysim_simple_server/data/
mcc-mnc-list.json, byte-identical to pbakondy/mcc-mnc-list master
commit 97bc1652, MIT) with license + provenance in
mcc-mnc-list.LICENSE; declared as package data so wheels carry it
- _default_mcc_mnc_list() now points at the bundled file;
--mcc-mnc-list still overrides it
- hide MVNO entries from the simulator picker (search + random): they
do not operate their own network. Detected via the `bands` field
('MVNO', 'Satellite MVNO', ...); the full list stays loaded so the
Network state panel still resolves operator names
- tests/test_mcc_mnc.py: bundled file ships/parses, marker variants,
search/random filters on fixtures and on the real list
- README/AGENTS updated; version trio 2.7.7; sw cache simple-v210
This commit is contained in:
@@ -29,11 +29,11 @@ def _default_web_dir():
|
||||
|
||||
|
||||
def _default_mcc_mnc_list():
|
||||
# Workspace default: the CC-BY-SA operator list lives outside the repo
|
||||
# (<workspace>/samples/mcc-mnc-list.json); clones can point elsewhere with
|
||||
# --mcc-mnc-list and the endpoint reports available=false when missing.
|
||||
repo = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
return os.path.normpath(os.path.join(repo, '..', 'samples', 'mcc-mnc-list.json'))
|
||||
# Bundled default: the MIT-licensed operator list ships with the package
|
||||
# (data/mcc-mnc-list.json, from pbakondy/mcc-mnc-list); --mcc-mnc-list
|
||||
# overrides it and the endpoint reports available=false when missing.
|
||||
pkg = os.path.dirname(os.path.abspath(__file__))
|
||||
return os.path.join(pkg, 'data', 'mcc-mnc-list.json')
|
||||
|
||||
|
||||
def main():
|
||||
@@ -47,7 +47,7 @@ def main():
|
||||
parser.add_argument('--web-dir', default=_default_web_dir(), metavar='PATH',
|
||||
help='Directory with the SIMple PWA static files to serve (default: <repo>/frontend)')
|
||||
parser.add_argument('--mcc-mnc-list', default=_default_mcc_mnc_list(), metavar='PATH',
|
||||
help='Worldwide MCC/MNC operator list (JSON) for the network-simulation operator picker (default: <workspace>/samples/mcc-mnc-list.json)')
|
||||
help='Worldwide MCC/MNC operator list (JSON) for the network-simulation operator picker (default: the bundled data/mcc-mnc-list.json)')
|
||||
parser.add_argument('--log-requests', action='store_true', default=False, help='Log request/response payloads to stderr')
|
||||
parser.add_argument('--sms-oa', default='12345', metavar='DIGITS',
|
||||
help='TP-Originating-Address (SMSC number) for the SMS-DELIVER TPDU (default: 12345)')
|
||||
|
||||
Reference in New Issue
Block a user