From 7c8fc323e101d18842bbbbe57a7e60885f87a461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 3 May 2019 16:38:24 +0200 Subject: [PATCH] [DOC] extras: update readme and server.py doc --- extras/readme.md | 17 ++++++++++++++++- extras/server.py | 8 ++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/extras/readme.md b/extras/readme.md index 38d929bb..246d7304 100644 --- a/extras/readme.md +++ b/extras/readme.md @@ -3,4 +3,19 @@ To help work/improve/learn with OWL, we have here: - a benchmarks application -- a playground application \ No newline at end of file +- a playground application + +Both of them can be accessed by using a static http server. A simple python +server is available in `server.py`. There is also a npm script to start it: +`npm run extras`. + +## Benchmarks + +The benchmarks application is a very small application, implemented in different +frameworks, and in different versions of Owl. This is a simple internal tool, +useful to compare various performance metrics on some tasks. + +## Playground + +The playground is an important application designed to help learning and +experimenting with Owl. It is available [online](https://odoo.github.io/owl/playground/). diff --git a/extras/server.py b/extras/server.py index 2f445058..45939a58 100644 --- a/extras/server.py +++ b/extras/server.py @@ -8,8 +8,13 @@ import SimpleHTTPServer HOST = '127.0.0.1' PORT = 8000 +URL = 'http://{0}:{1}/extras'.format(HOST, PORT) +# We define our own handler here to remap owl.js GET requests to the Owl build +# in dist/. This is useful for the benchmarks and playground applications. +# With this, we can simply copy the playground folder as is in the gh-page when +# we want to update the playground. class OWLHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): if self.path == '/extras/owl.js': @@ -24,8 +29,7 @@ def start_server(): if __name__ == "__main__": thread.start_new_thread(start_server, ()) - url = 'http://{0}:{1}/extras'.format(HOST, PORT) - webbrowser.open_new(url) + webbrowser.open_new(URL) while True: try: