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

Method get

dotdrop/linktypes.py:23–31  ·  view source on GitHub ↗

get the linktype

(cls, key, default=None)

Source from the content-addressed store, hash-verified

21
22 @classmethod
23 def get(cls, key, default=None):
24 """get the linktype"""
25 try:
26 return key if isinstance(key, cls) else cls[key.upper()]
27 except KeyError as exc:
28 if default and isinstance(default, cls):
29 return default
30 err = f'bad {cls.__name__} value: "{key}"'
31 raise ValueError(err) from exc
32
33 def __str__(self):
34 """linktype to string"""

Callers 15

__init__Method · 0.80
_adjust_yaml_keysMethod · 0.80
diffFunction · 0.80
check_versionFunction · 0.80
executeMethod · 0.80
_parse_blk_settingsMethod · 0.80
_norm_dotfilesMethod · 0.80
_enrich_varsMethod · 0.80
_resolve_profile_allMethod · 0.80

Calls

no outgoing calls

Tested by 2

test_excMethod · 0.64