Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, *args, **kwargs):
appier.App.__init__(
self,
name = "async_neo",
*args, **kwargs
)
self._register_model(Person)
__date__ = "$LastChangedDate$"
""" The last change date of the module """
__copyright__ = "Copyright (c) 2008-2018 Hive Solutions Lda."
""" The copyright for the module """
__license__ = "Apache License, Version 2.0"
""" The license for the module """
import time
import mimetypes
import appier
class AsyncApp(appier.App):
def __init__(self, *args, **kwargs):
appier.App.__init__(
self,
name = "async",
*args, **kwargs
)
@appier.route("/async", "GET")
@appier.route("/async/hello", "GET")
def hello(self):
partial = self.field("partial", True, cast = bool)
handler = self.handler_partial if partial else self.handler
yield from appier.header_a()
yield "before\n"
yield from handler()
__date__ = "$LastChangedDate$"
""" The last change date of the module """
__copyright__ = "Copyright (c) 2008-2019 Hive Solutions Lda."
""" The copyright for the module """
__license__ = "Apache License, Version 2.0"
""" The license for the module """
import time
import mimetypes
import appier
class AsyncOldApp(appier.App):
def __init__(self, *args, **kwargs):
appier.App.__init__(
self,
name = "async_old",
*args, **kwargs
)
@appier.route("/async", "GET")
@appier.route("/async/hello", "GET")
def hello(self):
partial = self.field("partial", True, cast = bool)
handler = self.handler_partial if partial else self.handler
for value in appier.header_a(): yield value
yield "before\n"
for value in handler(): yield value
__revision__ = "$LastChangedRevision$"
""" The revision number of the module """
__date__ = "$LastChangedDate$"
""" The last change date of the module """
__copyright__ = "Copyright (c) 2008-2016 Hive Solutions Lda."
""" The copyright for the module """
__license__ = "Apache License, Version 2.0"
""" The license for the module """
import appier
class HelloApp(appier.App):
def __init__(self, *args, **kwargs):
appier.App.__init__(
self,
name = "hello",
*args, **kwargs
)
@appier.route("/hello", "GET")
def hello(self):
return dict(
message = "hello world"
)
@appier.route("/hello/", "GET")
def hello_count(self, count):
__revision__ = "$LastChangedRevision$"
""" The revision number of the module """
__date__ = "$LastChangedDate$"
""" The last change date of the module """
__copyright__ = "Copyright (c) 2008-2019 Hive Solutions Lda."
""" The copyright for the module """
__license__ = "Apache License, Version 2.0"
""" The license for the module """
import appier
class HelloApp(appier.App):
def __init__(self, *args, **kwargs):
appier.App.__init__(
self,
name = "hello",
*args, **kwargs
)
@appier.route("/hello.tpl", "GET")
async def hello_template_async(self):
await appier.header_a()
yield await self.template_async(
"hello.txt",
message = "hello world"
)
__date__ = "$LastChangedDate$"
""" The last change date of the module """
__copyright__ = "Copyright (c) 2008-2019 Hive Solutions Lda."
""" The copyright for the module """
__license__ = "Apache License, Version 2.0"
""" The license for the module """
import time
import mimetypes
import appier
class AsyncNeoApp(appier.App):
def __init__(self, *args, **kwargs):
appier.App.__init__(
self,
name = "async_neo",
*args, **kwargs
)
@appier.route("/async", "GET")
@appier.route("/async/hello", "GET")
async def hello(self):
partial = self.field("partial", True, cast = bool)
handler = self.handler_partial if partial else self.handler
yield "before\n"
await handler()
yield "after\n"