text
stringlengths
0
828
self.logger.debug(f'Highest priority revision specified in the include statement: {revision}')
self.logger.debug(f'File in Git repository referenced; URL: {repo_url}, revision: {revision}')
repo_path = self._sync_repo(repo_url, revision)
self.logger.debug(f'Local path of the repo: {repo_path}')
included_file_path = repo_path / body.group('path')
self.logger.debug(f'Resolved path to the included file: {included_file_path}')
processed_content_part = self._process_include(
included_file_path,
body.group('from_heading'),
body.group('to_heading'),
options
)
else:
self.logger.debug('Local file referenced')
included_file_path = self._get_included_file_path(body.group('path'), markdown_file_path)
self.logger.debug(f'Resolved path to the included file: {included_file_path}')
processed_content_part = self._process_include(
included_file_path,
body.group('from_heading'),
body.group('to_heading'),
options
)
if self.options['recursive'] and self.pattern.search(processed_content_part):
self.logger.debug('Recursive call of include statements processing')
processed_content_part = self.process_includes(included_file_path, processed_content_part)
if options.get('inline'):
self.logger.debug('Processing included content part as inline')
processed_content_part = re.sub(r'\s+', ' ', processed_content_part).strip()
else:
processed_content_part = content_part
processed_content += processed_content_part
return processed_content"
1486,"def create_view_from_dict(name, spec, template=None, cls=ActionsView):
""""""Creates a view from an spec dict (typically, the YAML front-matter).
""""""
kwargs = dict(spec)
if template is not None:
kwargs.setdefault(""template"", template)
actions = load_grouped_actions(kwargs, pop_keys=True)
view = cls(name=name, **kwargs)
if isinstance(view, ActionsView):
view.actions.extend(actions)
return view"
1487,"def _parse_argv(argv=copy(sys.argv)):
""""""return argv as a parsed dictionary, looks like the following:
app --option1 likethis --option2 likethat --flag
->
{'option1': 'likethis', 'option2': 'likethat', 'flag': True}
""""""
cfg = DotDict()
cfg_files = []
argv = argv[1:] # Skip command name
while argv:
arg = argv.pop(0)
# split up arg in format --arg=val
key_val = re.split('=| ', arg)
arg = key_val[0]
try:
val = key_val[1]
except IndexError:
if len(argv) > 0 and argv[0][0] != '-':
val = argv.pop(0)
else:
# No val available, probably a flag
val = None
if arg[0] == '-':
key = arg.lstrip('-')
if not val:
val = True
new_cfg = _dict_from_dotted(key, val)
cfg = dict_merge(cfg, new_cfg)
else:
if arg.endswith("".yml""):
cfg_files.append(arg)