MCPcopy
hub / github.com/Nuitka/Nuitka / get

Method get

nuitka/utils/Yaml.py:503–535  ·  view source on GitHub ↗

Return a configs for that section.

(self, name, section)

Source from the content-addressed store, hash-verified

501 return "<PackageConfigYaml %s>" % self.name
502
503 def get(self, name, section):
504 """Return a configs for that section."""
505 result = self.data.get(name)
506
507 if result is not None:
508 result = result.get(section, ())
509 else:
510 result = ()
511
512 if section in (
513 "options",
514 "variables",
515 "constants",
516 ) and type(
517 result
518 ) in (dict, OrderedDict):
519 result = (result,)
520
521 if type(result) is list:
522 result = tuple(result)
523
524 # Ensure result is a tuple; otherwise exit with an error
525 if not isinstance(result, tuple):
526 self.logger.sysexit(
527 "Error, unexpected result type %s for %s module %s section %s."
528 % (type(result), self.name, name, section)
529 )
530
531 if result and (name, section) not in self.checked_sections:
532 checkSectionValues(self.logger, self.name, name, section, result)
533 self.checked_sections.add((name, section))
534
535 return result
536
537 def keys(self):
538 return self.data.keys()

Callers 15

_getEnvFunction · 0.45
runSconsBackendFunction · 0.45
_checkTqdmModuleFunction · 0.45
getModuleInfluencesFunction · 0.45
isRunningInInterpreterFunction · 0.45
_my_printFunction · 0.45
my_printFunction · 0.45

Calls 3

checkSectionValuesFunction · 0.85
sysexitMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected