From 68448d26e8668b05caef4716fa9159d22e1a00ea Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 10 Aug 2018 14:19:38 -0500 Subject: [PATCH] add skeleton --- Pipfile | 12 +++++ Pipfile.lock | 110 ++++++++++++++++++++++++++++++++++++++++++++++ viera/__init__.py | 12 +++++ viera/__main__.py | 25 +++++++++++ viera/actor.py | 0 viera/logging.py | 8 ++++ 6 files changed, 167 insertions(+) create mode 100644 Pipfile create mode 100644 Pipfile.lock create mode 100644 viera/__init__.py create mode 100644 viera/__main__.py create mode 100644 viera/actor.py create mode 100644 viera/logging.py diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..3d9ebbe --- /dev/null +++ b/Pipfile @@ -0,0 +1,12 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +aiohttp = "*" + +[dev-packages] + +[requires] +python_version = "3.6" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..244f9c3 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,110 @@ +{ + "_meta": { + "hash": { + "sha256": "5129d2cc073ad3de87f33a17d3e40a3a1776b7bbfc28b63c57b67dc1756f7080" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.6" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "aiohttp": { + "hashes": [ + "sha256:1a112a1fdf3802b7f2b182e22e51d71e4a8fa7387d0d38e79a268921b869e384", + "sha256:33aa7c937ebaf063a860cbb0c263a771b33333a84965c6148eeafe64fb4e29ca", + "sha256:550b4a0788500f6d00f41b7fdd9fcce6d78f99706a7b2f6f81d4d331c7ca468e", + "sha256:601e8e83123b4d423a9dfddf7d6943f4f520651a78ffcd50c99d065136c7ff7b", + "sha256:620f19ba7628b70b177f5c2e6a55a6fd6e7c8591cde38c3f8f52551733d31b66", + "sha256:70d56c784da1239c89d39fefa166fd429306dada641178389be4184a9c04e501", + "sha256:7de2c9e445a5d257935011268202338538abef1aaff341a4733eca56419ca6f6", + "sha256:96bb80b659cc2bafa160f3f0c346ce7fc10de1ffec4908d7f9690797f155f658", + "sha256:ae7501cc6a6c37b8d4774bf2218c37be47fe42019a2570e8510fc2044e59d573", + "sha256:c833aa6f4c9ac3e3eb843e3d999bae51339ad33a937303f43ce78064e61cb4b6", + "sha256:dd81d85a342edf3d2a388e2f24d9facebc9c04550043888f970ee2f228c93059", + "sha256:f20deec7a3fbaec7b5eb7ad99878427ad2ee4cc16a46732b705e8121cbb3cc12", + "sha256:f52e7287eb9286a1e91e4c67c207c2573147fbaddc68f70efb5aeee5d1992f2e", + "sha256:fe7b2972ff7e779e812f974aa5695edc328ecf559ceeea887ac46f06f090ad4c", + "sha256:ff1447c84a02b9cd5dd3a9332d1fb181a4386c3625765bb5caf1cfbc210ab3f9" + ], + "index": "pypi", + "version": "==3.3.2" + }, + "async-timeout": { + "hashes": [ + "sha256:474d4bc64cee20603e225eb1ece15e248962958b45a3648a9f5cc29e827a610c", + "sha256:b3c0ddc416736619bd4a95ca31de8da6920c3b9a140c64dbef2b2fa7bf521287" + ], + "markers": "python_version >= '3.5.3'", + "version": "==3.0.0" + }, + "attrs": { + "hashes": [ + "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", + "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" + ], + "version": "==18.1.0" + }, + "chardet": { + "hashes": [ + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + ], + "version": "==3.0.4" + }, + "idna": { + "hashes": [ + "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", + "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" + ], + "version": "==2.7" + }, + "idna-ssl": { + "hashes": [ + "sha256:a933e3bb13da54383f9e8f35dc4f9cb9eb9b3b78c6b36f311254d6d0d92c6c7c" + ], + "version": "==1.1.0" + }, + "multidict": { + "hashes": [ + "sha256:1a1d76374a1e7fe93acef96b354a03c1d7f83e7512e225a527d283da0d7ba5e0", + "sha256:1d6e191965505652f194bc4c40270a842922685918a4f45e6936a6b15cc5816d", + "sha256:295961a6a88f1199e19968e15d9b42f3a191c89ec13034dbc212bf9c394c3c82", + "sha256:2be5af084de6c3b8e20d6421cb0346378a9c867dcf7c86030d6b0b550f9888e4", + "sha256:2eb99617c7a0e9f2b90b64bc1fb742611718618572747d6f3d6532b7b78755ab", + "sha256:4ba654c6b5ad1ae4a4d792abeb695b29ce981bb0f157a41d0fd227b385f2bef0", + "sha256:5ba766433c30d703f6b2c17eb0b6826c6f898e5f58d89373e235f07764952314", + "sha256:a59d58ee85b11f337b54933e8d758b2356fcdcc493248e004c9c5e5d11eedbe4", + "sha256:a6e35d28900cf87bcc11e6ca9e474db0099b78f0be0a41d95bef02d49101b5b2", + "sha256:b4df7ca9c01018a51e43937eaa41f2f5dce17a6382fda0086403bcb1f5c2cf8e", + "sha256:bbd5a6bffd3ba8bfe75b16b5e28af15265538e8be011b0b9fddc7d86a453fd4a", + "sha256:d870f399fcd58a1889e93008762a3b9a27cf7ea512818fc6e689f59495648355", + "sha256:e9404e2e19e901121c3c5c6cffd5a8ae0d1d67919c970e3b3262231175713068" + ], + "markers": "python_version >= '3.4.1'", + "version": "==4.3.1" + }, + "yarl": { + "hashes": [ + "sha256:2556b779125621b311844a072e0ed367e8409a18fa12cbd68eb1258d187820f9", + "sha256:4aec0769f1799a9d4496827292c02a7b1f75c0bab56ab2b60dd94ebb57cbd5ee", + "sha256:55369d95afaacf2fa6b49c84d18b51f1704a6560c432a0f9a1aeb23f7b971308", + "sha256:6c098b85442c8fe3303e708bbb775afd0f6b29f77612e8892627bcab4b939357", + "sha256:9182cd6f93412d32e009020a44d6d170d2093646464a88aeec2aef50592f8c78", + "sha256:c8cbc21bbfa1dd7d5386d48cc814fe3d35b80f60299cdde9279046f399c3b0d8", + "sha256:db6f70a4b09cde813a4807843abaaa60f3b15fb4a2a06f9ae9c311472662daa1", + "sha256:f17495e6fe3d377e3faac68121caef6f974fcb9e046bc075bcff40d8e5cc69a4", + "sha256:f85900b9cca0c67767bb61b2b9bd53208aaa7373dae633dbe25d179b4bf38aa7" + ], + "version": "==1.2.6" + } + }, + "develop": {} +} diff --git a/viera/__init__.py b/viera/__init__.py new file mode 100644 index 0000000..4cfb05c --- /dev/null +++ b/viera/__init__.py @@ -0,0 +1,12 @@ +from . import logging + + +import asyncio +import aiohttp +import aiohttp.web + + +app = aiohttp.web.Application() + + +from . import actor diff --git a/viera/__main__.py b/viera/__main__.py new file mode 100644 index 0000000..3b2caea --- /dev/null +++ b/viera/__main__.py @@ -0,0 +1,25 @@ +import asyncio +import aiohttp.web +import logging + +from . import app + + +async def start_webserver(): + runner = aiohttp.web.AppRunner(app) + await runner.setup() + + logging.info('Starting webserver at localhost:8080') + + site = aiohttp.web.TCPSite(runner, 'localhost', 8080) + await site.start() + + +def main(): + loop = asyncio.get_event_loop() + asyncio.ensure_future(start_webserver()) + loop.run_forever() + + +if __name__ == '__main__': + main() diff --git a/viera/actor.py b/viera/actor.py new file mode 100644 index 0000000..e69de29 diff --git a/viera/logging.py b/viera/logging.py new file mode 100644 index 0000000..f7d0977 --- /dev/null +++ b/viera/logging.py @@ -0,0 +1,8 @@ +import logging + + +logging.basicConfig( + level=logging.INFO, + format="[%(asctime)s] %(levelname)s: %(message)s", + handlers=[logging.StreamHandler()] +)