Skip to content

Commit bf048d6

Browse files
committed
rm global stagpy.conf
1 parent f419e5c commit bf048d6

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
sys.path.insert(0, os.path.abspath(".."))
2222

23-
import stagpy
23+
from stagpy.config import Config
2424

2525
html_theme = "sphinx_rtd_theme"
2626

@@ -93,7 +93,8 @@
9393
"""
9494
)
9595
)
96-
for sec_fld in fields(stagpy.conf):
96+
stagpy_conf = Config.default_()
97+
for sec_fld in fields(stagpy_conf):
9798
sec_name = sec_fld.name
9899
fid.write(
99100
dedent(
@@ -107,7 +108,7 @@
107108
""".format(sec_name)
108109
)
109110
)
110-
section = getattr(stagpy.conf, sec_name)
111+
section = getattr(stagpy_conf, sec_name)
111112
for fld in fields(section):
112113
opt = fld.name
113114
entry = section.meta_(opt).entry

docs/sources/apiref/stagpy.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,3 @@ stagpy
1212
commits since the last stable version and the last commit hash. If you
1313
made modifications to the code that are not committed yet, the date of
1414
the last modification appears in the ``'.dYYYYMMDD'`` segment.
15-
16-
.. data:: conf
17-
18-
Global :class:`loam.manager.ConfigurationManager` instance, holding
19-
configuration options.

stagpy/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import sys
2121
import typing
2222

23-
from . import config
24-
2523
if typing.TYPE_CHECKING:
2624
from typing import Any, NoReturn
2725

@@ -60,9 +58,5 @@ def sigint_handler(*_: Any) -> NoReturn:
6058
except ImportError:
6159
__version__ = "unknown"
6260

63-
conf = config.Config.default_()
64-
if config.CONFIG_LOCAL.is_file():
65-
conf.update_from_file_(config.CONFIG_LOCAL)
66-
6761
if not DEBUG:
6862
signal.signal(signal.SIGINT, _PREV_INT)

stagpy/__main__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ def main() -> None:
1212
if not DEBUG:
1313
signal.signal(signal.SIGINT, sigint_handler)
1414
warnings.simplefilter("ignore")
15-
from . import args, conf, error
15+
from . import args, config, error
16+
17+
conf = config.Config.default_()
18+
if config.CONFIG_LOCAL.is_file():
19+
conf.update_from_file_(config.CONFIG_LOCAL)
1620

1721
try:
1822
args.parse_args(conf)(conf)

0 commit comments

Comments
 (0)