MCPcopy Index your code
hub / github.com/pyinvoke/invoke / __init__

Method __init__

invoke/config.py:512–655  ·  view source on GitHub ↗

Creates a new config object. :param dict defaults: A dict containing default (lowest level) config data. Default: `global_defaults`. :param dict overrides: A dict containing override-level config data. Default: ``{}``. :param st

(
        self,
        overrides: Optional[Dict[str, Any]] = None,
        defaults: Optional[Dict[str, Any]] = None,
        system_prefix: Optional[str] = None,
        user_prefix: Optional[str] = None,
        project_location: Optional[PathLike] = None,
        runtime_path: Optional[PathLike] = None,
        lazy: bool = False,
    )

Source from the content-addressed store, hash-verified

510 }
511
512 def __init__(
513 self,
514 overrides: Optional[Dict[str, Any]] = None,
515 defaults: Optional[Dict[str, Any]] = None,
516 system_prefix: Optional[str] = None,
517 user_prefix: Optional[str] = None,
518 project_location: Optional[PathLike] = None,
519 runtime_path: Optional[PathLike] = None,
520 lazy: bool = False,
521 ):
522 """
523 Creates a new config object.
524
525 :param dict defaults:
526 A dict containing default (lowest level) config data. Default:
527 `global_defaults`.
528
529 :param dict overrides:
530 A dict containing override-level config data. Default: ``{}``.
531
532 :param str system_prefix:
533 Base path for the global config file location; combined with the
534 prefix and file suffixes to arrive at final file path candidates.
535
536 Default: ``/etc/`` (thus e.g. ``/etc/invoke.yaml`` or
537 ``/etc/invoke.json``).
538
539 :param str user_prefix:
540 Like ``system_prefix`` but for the per-user config file. These
541 variables are joined as strings, not via path-style joins, so they
542 may contain partial file paths; for the per-user config file this
543 often means a leading dot, to make the final result a hidden file
544 on most systems.
545
546 Default: ``~/.`` (e.g. ``~/.invoke.yaml``).
547
548 :param str project_location:
549 Optional directory path of the currently loaded `.Collection` (as
550 loaded by `.Loader`). When non-empty, will trigger seeking of
551 per-project config files in this directory.
552
553 :param str runtime_path:
554 Optional file path to a runtime configuration file.
555
556 Used to fill the penultimate slot in the config hierarchy. Should
557 be a full file path to an existing file, not a directory path or a
558 prefix.
559
560 :param bool lazy:
561 Whether to automatically load some of the lower config levels.
562
563 By default (``lazy=False``), ``__init__`` automatically calls
564 `load_system` and `load_user` to load system and user config files,
565 respectively.
566
567 For more control over what is loaded when, you can say
568 ``lazy=True``, and no automatic loading is done.
569

Callers

nothing calls this directly

Calls 7

global_defaultsMethod · 0.95
set_project_locationMethod · 0.95
set_runtime_pathMethod · 0.95
load_base_conf_filesMethod · 0.95
mergeMethod · 0.95
copy_dictFunction · 0.85
_setMethod · 0.80

Tested by

no test coverage detected