This is framework, around aiohttp_traversal.
$ pip install aiotraversal
$ git clone https://github.com/zzzsochi/aiotraversal.git
$ cd aiotraversal
$ pip install pytest pytest-cov
$ py.test --cov ./aiotraversal --cov-report term-missing
$ git clone https://github.com/zzzsochi/aiotraversal.git
$ cd aiotraversal
$ pip install -e .
$ python3 examples/1-hello.py serve
$ curl http://localhost:8080
Hello World!
$ curl http://localhost:8080/json
{"text": "Hello World!"}
- Update for new aiohttp;
- Remove
Configure.register_on_finish
(fuck b/c!); - Add
Configure.on_cleanup
list for serial cleanup process; - Fix bug in
Configure.bind_view
witn exceptions.
- Start documentation
- Add settings;
- Move
Application.start
toaiotraversal.serve.start_listening
function; - Refactoring, refactoring, refactoring, refactoring...
Started CHANGES;
New configuration process:
def main(): loop = asyncio.get_event_loop() app = Application() with app.configure(loop=loop) as config: config.include(func) app.start() def func(config): work_configure()
Add
Configure.include_deferred
;Add modules for command line:
aiotraversal.cmd
;aiotraversal.logger
;aiotraversal.serve
;
import asyncio from aiotraversal import Application from aiotraversal.cmd import run def main(): loop = asyncio.get_event_loop() app = Application() with app.configure(loop=loop) as config: config.include('aiotraversal.cmd') config.include('aiotraversal.logger') config.include('aiotraversal.serve') run(app, loop) if __name__ == '__main__': main()
$ cmd usage: cmd [--loglevel WARNING] {help,serve} ... positional arguments: {help,serve} help Print this help serve Start web server optional arguments: --loglevel WARNING Set log level $ cmd --loglevel=DEBUG serve INFO:aiotraversal.app:listening - localhost:8080 ^CDEBUG:aiotraversal.cmd:finishing application DEBUG:aiotraversal.cmd:closing loop