mosaic-headless 1.29.2 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,6 +32,7 @@ under the same milestone, one chunk per request, `totalChunks` on each.
32
32
  """
33
33
  from __future__ import annotations
34
34
 
35
+ import mosaic_config
35
36
  import argparse
36
37
  import email.parser
37
38
  import email.policy
@@ -202,19 +203,21 @@ def main():
202
203
  ap = argparse.ArgumentParser()
203
204
  sub = ap.add_subparsers(dest="cmd", required=True)
204
205
  e = sub.add_parser("export")
205
- e.add_argument("--config", required=True)
206
+ e.add_argument("--config",
207
+ help="JSON with base/cookie/nonce; omit it and the MOSAIC_SITE_URL / MOSAIC_REST_COOKIE / MOSAIC_REST_NONCE environment variables supply them instead")
206
208
  e.add_argument("--theme", help="themeID; default is the config's")
207
209
  e.add_argument("--out", required=True)
208
210
  e.add_argument("--simple", action="store_true", help="Mosaic's simpleExport flag")
209
211
  i = sub.add_parser("import")
210
- i.add_argument("--config", required=True)
212
+ i.add_argument("--config",
213
+ help="JSON with base/cookie/nonce; omit it and the MOSAIC_SITE_URL / MOSAIC_REST_COOKIE / MOSAIC_REST_NONCE environment variables supply them instead")
211
214
  i.add_argument("--zip", required=True)
212
215
  i.add_argument("--activate", action="store_true",
213
216
  help="make the imported theme the live site (default: test mode)")
214
217
  i.add_argument("--replace", metavar="THEMEID",
215
218
  help="DELETE this theme and import over it")
216
219
  a = ap.parse_args()
217
- cfg = json.load(open(a.config, encoding="utf-8"))
220
+ cfg = mosaic_config.load(a.config)
218
221
  (export_theme if a.cmd == "export" else import_theme)(a, cfg)
219
222
 
220
223
 
@@ -47,6 +47,7 @@ rated `error`.
47
47
  """
48
48
  from __future__ import annotations
49
49
 
50
+ import mosaic_config
50
51
  import argparse
51
52
  import csv
52
53
  import json
@@ -605,7 +606,8 @@ def resolve_tokens(value, spec):
605
606
 
606
607
  def main():
607
608
  ap = argparse.ArgumentParser()
608
- ap.add_argument("--config", required=True)
609
+ ap.add_argument("--config",
610
+ help="JSON with base/cookie/nonce; omit it and the MOSAIC_SITE_URL / MOSAIC_REST_COOKIE / MOSAIC_REST_NONCE environment variables supply them instead")
609
611
  ap.add_argument("--site", required=True)
610
612
  ap.add_argument("--csv", help="the computed-value table")
611
613
  ap.add_argument("--audit", help="the design-audit findings")
@@ -617,7 +619,7 @@ def main():
617
619
  ap.add_argument("--page", help="only this slug")
618
620
  a = ap.parse_args()
619
621
 
620
- cfg = json.load(open(a.config, encoding="utf-8"))
622
+ cfg = mosaic_config.load(a.config)
621
623
  spec = json.load(open(a.site, encoding="utf-8"))
622
624
 
623
625
  rows, findings, hard = [], [], 0
@@ -43,6 +43,7 @@ cannot run, the overlay does not exist. The failure direction is "no intro", nev
43
43
  """
44
44
  from __future__ import annotations
45
45
 
46
+ import mosaic_config
46
47
  import argparse
47
48
  import csv
48
49
  import json
@@ -249,7 +250,8 @@ def changed(readings, ids):
249
250
 
250
251
  def main():
251
252
  ap = argparse.ArgumentParser()
252
- ap.add_argument("--config", required=True)
253
+ ap.add_argument("--config",
254
+ help="JSON with base/cookie/nonce; omit it and the MOSAIC_SITE_URL / MOSAIC_REST_COOKIE / MOSAIC_REST_NONCE environment variables supply them instead")
253
255
  ap.add_argument("--site", required=True)
254
256
  ap.add_argument("--page")
255
257
  ap.add_argument("--veil-prefix", default="mk-boot",
@@ -262,7 +264,7 @@ def main():
262
264
  ap.add_argument("--frames")
263
265
  a = ap.parse_args()
264
266
 
265
- cfg = json.load(open(a.config, encoding="utf-8"))
267
+ cfg = mosaic_config.load(a.config)
266
268
  spec = json.load(open(a.site, encoding="utf-8"))
267
269
  slug = a.page or spec["pages"][0]["slug"]
268
270
  url = "%s/%s/" % (cfg["base"].rstrip("/"), slug)
@@ -53,6 +53,7 @@ breakpoint declared. Writing narrow-screen `customDeclarations` that simply omit
53
53
  leaves the wide-screen border standing, drawing rules in the middle of nowhere on a
54
54
  collapsed layout. Every such omission is reported as RESET-RISK.
55
55
  """
56
+ import mosaic_config
56
57
  import argparse
57
58
  import csv
58
59
  import json
@@ -292,12 +293,13 @@ def component_tree(spec, name, instance_attr):
292
293
 
293
294
  def main():
294
295
  ap = argparse.ArgumentParser()
295
- ap.add_argument("--config", required=True)
296
+ ap.add_argument("--config",
297
+ help="JSON with base/cookie/nonce; omit it and the MOSAIC_SITE_URL / MOSAIC_REST_COOKIE / MOSAIC_REST_NONCE environment variables supply them instead")
296
298
  ap.add_argument("--site", required=True)
297
299
  ap.add_argument("--csv")
298
300
  a = ap.parse_args()
299
301
 
300
- cfg = json.load(open(a.config, encoding="utf-8"))
302
+ cfg = mosaic_config.load(a.config)
301
303
  site = json.load(open(a.site, encoding="utf-8"))
302
304
  base = cfg["base"].rstrip("/")
303
305