Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def entrypoints_from_configparser(cp):
res = []
for group_name, group in sorted(cp.items()):
for name, epstr in sorted(group.items()):
m = entry_point_pattern.match(epstr)
if m:
mod, obj, extras = m.group('modulename', 'objectname', 'extras')
if extras is not None:
extras = [e.strip() for e in extras.split(',')]
res.append({
'group': group_name,
'name': name,
'module_name': mod,
'object_name': obj,
'extras': extras,
})
else:
log.warning("Invalid entry point specification: %r", epstr)
return res