Contribution:
bottle2
Headline
An extension of Contribution:py3k, using Technology:Bottle as a framework for Feature:Web UI.
Characteristics
The most prominent feature of this contribution is the Feature:Web UI. The Server is implemented using Bottle and communicates with the Client using the Web UI REST API.
Illustration
Technology:Bottle uses route handlers to apply incoming connections to specified functions.
# When a client GETs the root URL, send the default client page
@get('/')
def index():
return static file('web ui.html', './public')
# Sends the model to the client (the request is usually made via AJAX)
@post('/')
def config():
return web ui
Each action from the client is handled via such a route handler.
Take for example the handler for Feature:Cut:
@post('/cut')
def cut():
# Get the node to start cutting from
obj, error = object from('id')
if not obj: return error
# Aggregate the employees that have been cut so the client can update them
commands = []
for employee in obj.cut():
# Manual conversion of employees to JSON
commands.append({'type' : 'edit', 'node' : employee.to json()})
# Send AJAX response
return {'commands' : commands}
Relationships
- Contribution:jsTree is the default Client for this contribution.
- Contribution:py3k was the base inspiration for this contribution, but the resemblance isn't too recognizable anymore.
- Contribution:dancer is a similar Server, using Language:Perl and Technology:Dancer instead.
Architecture
The model-related classes and validator are both separate Python modules. The server itself is just a single Python script.
Usage
Please see the readme.md on GitHub for details.
User contributions
User edits
Syntax for editing wiki
For you are available next options:will make text bold.
will make text italic.
will make text underlined.
will make text striked.
will allow you to paste code headline into the page.
will allow you to link into the page.
will allow you to paste code with syntax highlight into the page. You will need to define used programming language.
will allow you to paste image into the page.
is list with bullets.
is list with numbers.
will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.
will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.
will allow your to insert code snippets from @worker.
Syntax for editing wiki
For you are available next options:will make text bold.
will make text italic.
will make text underlined.
will make text striked.
will allow you to paste code headline into the page.
will allow you to link into the page.
will allow you to paste code with syntax highlight into the page. You will need to define used programming language.
will allow you to paste image into the page.
is list with bullets.
is list with numbers.
will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.
will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.
will allow your to insert code snippets from @worker.