Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def callable(self):
sleep = self.field("sleep", 3.0, cast = float)
yield from appier.header_a()
yield "before\n"
yield from appier.ensure_a(lambda: time.sleep(sleep))
yield "after\n"
async def file(self):
file_path = self.field("path", None, mandatory = True)
delay = self.field("delay", 0.0, cast = float)
thread = self.field("thread", False, cast = bool)
type, _encoding = mimetypes.guess_type(file_path, strict = True)
type = type or "application/octet-stream"
self.request.content_type = type
await appier.ensure_a(
self.read_file,
args = [file_path],
kwargs = dict(delay = delay),
thread = thread
)
def callable(self):
sleep = self.field("sleep", 3.0, cast = float)
for value in appier.header_a(): yield value
yield "before\n"
for value in appier.ensure_a(lambda: time.sleep(sleep)): yield value
yield "after\n"
def file(self):
file_path = self.field("path", None, mandatory = True)
delay = self.field("delay", 0.0, cast = float)
thread = self.field("thread", False, cast = bool)
type, _encoding = mimetypes.guess_type(file_path, strict = True)
type = type or "application/octet-stream"
self.request.content_type = type
for value in appier.header_a(): yield value
for value in appier.ensure_a(
self.read_file,
args = [file_path],
kwargs = dict(delay = delay),
thread = thread
): yield value
def file(self):
file_path = self.field("path", None, mandatory = True)
delay = self.field("delay", 0.0, cast = float)
thread = self.field("thread", False, cast = bool)
type, _encoding = mimetypes.guess_type(file_path, strict = True)
type = type or "application/octet-stream"
self.request.content_type = type
yield from appier.header_a()
yield from appier.ensure_a(
self.read_file,
args = [file_path],
kwargs = dict(delay = delay),
thread = thread
)