mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[DOC] extras: update readme and server.py doc
This commit is contained in:
+16
-1
@@ -3,4 +3,19 @@
|
|||||||
To help work/improve/learn with OWL, we have here:
|
To help work/improve/learn with OWL, we have here:
|
||||||
|
|
||||||
- a benchmarks application
|
- a benchmarks application
|
||||||
- a playground application
|
- 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/).
|
||||||
|
|||||||
+6
-2
@@ -8,8 +8,13 @@ import SimpleHTTPServer
|
|||||||
|
|
||||||
HOST = '127.0.0.1'
|
HOST = '127.0.0.1'
|
||||||
PORT = 8000
|
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):
|
class OWLHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
if self.path == '/extras/owl.js':
|
if self.path == '/extras/owl.js':
|
||||||
@@ -24,8 +29,7 @@ def start_server():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
thread.start_new_thread(start_server, ())
|
thread.start_new_thread(start_server, ())
|
||||||
url = 'http://{0}:{1}/extras'.format(HOST, PORT)
|
webbrowser.open_new(URL)
|
||||||
webbrowser.open_new(url)
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user