in modular_api/commands_generator.py [0:0]
def _get_default_route_config(self, group_full_name, command_name, subgroup):
full_group_path = '/'.join(group_full_name) \
if isinstance(group_full_name, list) else group_full_name
if subgroup:
module_path = str(self._module)
resolved_parents = re.search('\w*.(?=.py)', module_path).group(0)
path_components = resolved_parents.split('_')
subgroup_path = '/'.join(component for component in path_components)
path = f'/{subgroup_path}/{command_name}' \
if self._mount_point == '/' \
else f'{self._mount_point}/{subgroup_path}/{command_name}'
else:
path = f'/{full_group_path}/{command_name}' \
if self._mount_point == '/' \
else f'{self._mount_point}/{full_group_path}/{command_name}'
return {
'method': self.DEFAULT_METHOD,
'path': path,
'group_path': path
}