Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loads = lambda data: yaml.safe_load(data)
dumps = lambda data: yaml.safe_dump(data)
class LineRange(Schema):
start = fields.Integer(default=0, missing=0)
end = fields.Integer(default=None, missing=None)
class FileSchema(Schema):
path = fields.Str()
relative = fields.Boolean(default=True, missing=True)
lang = fields.Str(default="auto", missing="auto")
transform = fields.Str(default=None, missing=None)
lines = fields.Nested(
LineRange,
default=LineRange().dump(LineRange()),
missing=LineRange().dump(LineRange()),
)
class Meta:
render_module = YamlRender
def transform_data(transform_shell_cmd, input_data):
"""Transform the ``input_data`` using the ``transform_shell_cmd``
shell command.
"""
proc = subprocess.Popen(
transform_shell_cmd,
shell=True,
stdout=subprocess.PIPE,
class LineRange(Schema):
start = fields.Integer(default=0, missing=0)
end = fields.Integer(default=None, missing=None)
class FileSchema(Schema):
path = fields.Str()
relative = fields.Boolean(default=True, missing=True)
lang = fields.Str(default="auto", missing="auto")
transform = fields.Str(default=None, missing=None)
lines = fields.Nested(
LineRange,
default=LineRange().dump(LineRange()),
missing=LineRange().dump(LineRange()),
)
class Meta:
render_module = YamlRender
def transform_data(transform_shell_cmd, input_data):
"""Transform the ``input_data`` using the ``transform_shell_cmd``
shell command.
"""
proc = subprocess.Popen(
transform_shell_cmd,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE,
dumps = lambda data: yaml.safe_dump(data)
class LineRange(Schema):
start = fields.Integer(default=0, missing=0)
end = fields.Integer(default=None, missing=None)
class FileSchema(Schema):
path = fields.Str()
relative = fields.Boolean(default=True, missing=True)
lang = fields.Str(default="auto", missing="auto")
transform = fields.Str(default=None, missing=None)
lines = fields.Nested(
LineRange,
default=LineRange().dump(LineRange()),
missing=LineRange().dump(LineRange()),
)
class Meta:
render_module = YamlRender
def transform_data(transform_shell_cmd, input_data):
"""Transform the ``input_data`` using the ``transform_shell_cmd``
shell command.
"""
proc = subprocess.Popen(
transform_shell_cmd,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,