Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def register():
return {
'changes': changes_transform_factory,
'python': bake_parametrized(python_transform, pass_conf=True),
'bash': bake_parametrized(bash_transform),
'shell': bake_parametrized(bash_transform),
}
def register():
"""
Return dictionary of tranform factories
"""
registry = {
key: bake_html(key)
for key in ('css', 'css-all', 'tag', 'text')
}
registry['xpath'] = bake_parametrized(xpath_selector, select_all=False)
registry['xpath-all'] = bake_parametrized(xpath_selector, select_all=True)
return registry
command = jq(query, _in=text)
if not command.stderr:
success, result = True, command.stdout.decode('utf-8')
else:
success, result = False, command.stderr.decode('utf-8')
except sh.ErrorReturnCode as exc:
logger.exception("jq failure")
success, result = False, exc.stderr
logger.debug("jq transform success: %r, content: %r",
success, result)
return success, result
JSON_REGISTRY = {
'json': wrap_dummy(pretty_json),
'jq': bake_parametrized(run_jq),
}
def register():
return {
'changes': changes_transform_factory,
'python': bake_parametrized(python_transform, pass_conf=True),
'bash': bake_parametrized(bash_transform),
'shell': bake_parametrized(bash_transform),
}
def register():
"""
Return dictionary of transform factories
"""
registry = {
'xpath': bake_parametrized(xpath_selector, select_all=False),
'xpath-all': bake_parametrized(xpath_selector, select_all=True)
}
return registry