MCPcopy
hub / github.com/deadc0de6/dotdrop / _norm_path

Method _norm_path

dotdrop/cfg_yaml.py:1782–1797  ·  view source on GitHub ↗

Resolve a path either absolute or relative to config path

(self, path)

Source from the content-addressed store, hash-verified

1780 return glob.glob(expanded_path, recursive=True)
1781
1782 def _norm_path(self, path):
1783 """Resolve a path either absolute or relative to config path"""
1784 if not path:
1785 return path
1786 path = os.path.expanduser(path)
1787 if not os.path.isabs(path):
1788 dirn = os.path.dirname(self._path)
1789 ret = os.path.join(dirn, path)
1790 if self._debug:
1791 msg = f'normalizing relative to cfg: {path} -> {ret}'
1792 self._dbg(msg)
1793 path = ret
1794 ret = os.path.normpath(path)
1795 if self._debug and path != ret:
1796 self._dbg(f'normalizing: {path} -> {ret}')
1797 return ret
1798
1799 def _shell_exec_dvars(self, dic, keys=None):
1800 """shell execute dynvariables in-place"""

Callers 6

resolve_dotfile_srcMethod · 0.95
resolve_dotfile_dstMethod · 0.95
_parse_blk_settingsMethod · 0.95
_enrich_varsMethod · 0.95
_import_configMethod · 0.95
_process_pathMethod · 0.95

Calls 1

_dbgMethod · 0.95

Tested by

no test coverage detected