zoom.apps module

zoom.apps

handles requests by locating and calling a suitable app

class zoom.apps.App

Bases: object

A Zoom application

Looks for a method to satisfy the request. If the method is not specified, it falls back to ‘index’. If there is no method on the app object to satisfy the method then it looks for a file in the app directory by that same name. If it finds such a file it looks for the an entrypoint and if found it calls the entrypoint with the parameters the entrypoint expects.

process(*route, **data)

Process request parameters

static(*args, **kwargs)
class zoom.apps.AppProxy(name, filename, site)

Bases: object

App Proxy

Contains the various extra supporting parts of an app besides the actual functionality. Apps themselves are simply callables that accept a request and return a response. They can be implemented as simple functions or as something more substantial such as a subclass of the App class above. That’s entirely up to the app developer. The AppProxy takes care of the other parts that an app needs, from it’s location to it’s icon to it’s config files.

description

Returns the app description

get_config(default=None)

get the app config

get_icon_view()
keywords

Returns the app keywords

menu()

generate an app menu

method

Returns the app callable entry point

read_config(section, key, default=None)

read app config file values

run(request)

run the app

run_background_jobs()
templates_paths

Calculate Templates Paths

title

Returns the app title

class zoom.apps.NoApp

Bases: object

default app used when no app is available

This is mostly used so the helpers remain valid and return reasonable values when no app is available.

menu = ''
menu_items = []
name = 'none'
theme = None
url = ''
zoom.apps.get_default_app_name(site, user)

get the default app for the currrent user

zoom.apps.get_main_apps(request)

Returns a list of the main apps.

Main apps are apps that appear in the main menu, which is usually found at the top of a web site’s pages. The system menu typically includes apps such as home, admin and the apps app.

This list can be defined in the site.ini file in the [apps] section using the key main. A example is provided in the default site.ini file.

zoom.apps.get_system_apps(request)

Returns a list containing the system apps.

System apps are apps that appear in the system menu, which is usually found at the top left of a web site. The system menu typically includes apps such as login, logout, profile and register.

This list can be defined in the site.ini file in the [apps] section using the key system. A example is provided in the default site.ini file.

zoom.apps.handle(request)

handle a request

zoom.apps.handler(request, next_handler, *rest)

Dispatch request to an application

zoom.apps.helpers(request)

return a dict of app helpers

zoom.apps.load_app(site, name)

get the location of an app by name

zoom.apps.load_module(module, filename)

Dynamically load a module

zoom.apps.main_menu(request)

Returns the main menu.

zoom.apps.main_menu_items(request)

Returns the main menu.

zoom.apps.respond(content, request)

construct a response

zoom.apps.system_menu(request)

Returns the system menu.

zoom.apps.system_menu_items(request)

Returns the system menu.