Skipole WSGI generator.


Introduction Getting Started Your Code start_call submit_data end_call skicall skicall.page_data

Tests at PythonAnywhere:


Development at Bitbucket:

Skipole Project Documentation Downloads


Your 'start_call', 'submit_data' and 'end_call' functions are used to populate the attribute 'skicall.page_data' which is a dictionary. This dictionary contents are used to set the widget fields of the final template page returned.

The keys of page_data are of the form:

If a widget is in a section:

skicall.page_data[sectionalias,widgetname,fieldname] = value

If a widget is not in a section:

skicall.page_data[widgetname,fieldname] = value

This framework often refers to the key tuple (widgetname,fieldname) as a widgfield.

Most of the skicall.page_data fields will be of the above form, however there are keys which set certain parameters, optionally overriding parameters set when the page is created:

skicall.page_data[sectionalias, 'hide'] - Set True to hide the section

skicall.page_data[sectionalias, 'multiplier'] - A section can be displayed multiple times - this sets the number of times this section to be shown

skicall.page_data[sectionalias, 'multiplier_tag'] - Set the section tag containing each section when multiplied

skicall.page_data[sectionalias, 'section_class'] - Set CSS class on the section

skicall.page_data[sectionalias, 'show'] - Set False to remove the section

These literal string keys set page parameters:

skicall.page_data['add_jscript'] - Set to a string containing javascript code. This will be set within the pages automatically generated "$(document).ready(function(){})" and will be run when the page is loaded.

skicall.page_data['backcol'] - Set the 'HTML' tag background color

skicall.page_data['body_class'] - The CSS class of the 'BODY' tag

skicall.page_data['headers'] - Sets the returned page headers

skicall.page_data['ident_data'] - Set to a string, which will be returned as the 'skicall.ident_data' attribute if this page submits any data.

skicall.page_data['lang'] - Set the language, such as 'en' in the page 'HTML' tag. This is independent of the skicall lang and language attributes, though it would generally be set the same as skicall.language.

skicall.page_data['last_scroll'] - Set True to display the page at its last scroll position

skicall.page_data['localStorage'] - A dictionary of string keys and values to set in the browser storage

skicall.page_data['sessionStorage'] - A dictionary of string keys and values to set in the browser storage

skicall.page_data['show_backcol'] - Set True to enable the 'HTML' tag background color

skicall.page_data['show_error'] - Error message to be shown on the page default error widget

skicall.page_data['status'] - Sets the returned page status

For File pages:

skicall.page_data['filepath'] - The path (relative to projectfiles) to the linked static file.

skicall.page_data['mimetype'] - The mime type of the file.

skicall.page_data['enable_cache'] - If True instructs the client to cache the file.

For SVG pages (dynamic created pages, not static files):

skicall.page_data['height'] - Set the height

skicall.page_data['width'] - Set the width

skicall.page_data['enable_cache'] - Enables client cache of this page.

For CSS pages (dynamic created pages, not static files):

skicall.page_data['@import'] - A string or a list

skicall.page_data['enable_cache'] - Enables client cache of this page.

For JSON pages:

Those Widgets which submit data, or link to another page, are generally set with the page to call, and an HTML template page is returned. However some widgets can request a JSON page (requires javascript to be enabled in the client browser).

In this case an alternative HTML page such as 'no_javascript' can be set in the HTML link field, which will be shown if the JSON call fails.

When a JSON request is made - you would typically call a Responder which sets the skicall.page_data widgfield/values into the target page 'general_json'. This being an empty JSON file which is then populated with the dictionary.

On being received by the client the page widget fields will be updated, this will be quick, as a whole page is not sent, and looks very dynamic. Only certain widgfields are 'JSON enabled' and can be updated - this is shown in the widget documentation for each field.

As well as widgets, on setting up a Template Page you will see that the page can be set to make a JSON call at set intervals. Again this can be useful to continuously update required fields on the page.

As well as widgfields, the JSONtoHTML value can be set when returning a JSON page:

skicall.page_data['JSONtoHTML'] - A url to divert to.

This causes the client to call this target url.