1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""The file backing of ``FreeCAD.ParamGet`` (a FerroCAD-only control).
Upstream FreeCAD keeps parameters in a platform-specific preferences file; this
module names **which** file FerroCAD uses and lets a caller point it elsewhere.
``ParamGet``/``ParameterGrp`` themselves stay on ``FreeCAD`` because their shape
is upstream's. See ``docs/architecture/api-namespaces.md``.
The default resolution is:
1. the path passed to :func:`set_parameter_file`;
2. ``FERROCAD_PARAM_FILE``;
3. ``$XDG_CONFIG_HOME/ferrocad/parameters.json`` (falling back to
``~/.config/ferrocad/parameters.json``), enabled only when
``FreeCAD.GuiUp`` is truthy.
Headless processes therefore stay in memory unless a path is set explicitly.
The file is versioned JSON, loaded lazily by the first ``ParamGet`` after a path
is configured, and replaced atomically on every mutation.
"""
"""Point ``FreeCAD.ParamGet`` at ``path`` (always enabled).
``path`` is normally a JSON file; its parent directory is created on the
first write. Pass ``None`` to clear the explicit path and fall back to
``FERROCAD_PARAM_FILE`` / the GUI-only default.
The file is read lazily on the next ``ParamGet``. Calling this again with
the same path re-arms that load, which is how a restart is simulated.
"""
"""The parameter file in use, or ``None`` while the store is memory-only."""
return
=