1.1.7.9. gnr.web.gnrwsgisite

Last page update: November 23, 2011

Main class:

Other classes:

Exceptions classes:

Complete reference:

1.1.7.9.2. SiteLock

1.1.7.9.3. memoize

1.1.7.9.4. GnrSiteException

there is no public method.

1.1.7.9.5. gnr.web.gnrwsgisite - The complete reference list

exception gnr.web.gnrwsgisite.GnrSiteException(description=None, **kwargs)

Standard Genro Site Exception

  • code: GNRSITE-001
  • description: Genro Site Exception
class gnr.web.gnrwsgisite.GnrWsgiSite(script_path, site_name=None, _config=None, _gnrconfig=None, counter=None, noclean=None, options=None)

TODO

adaptStaticArgs(static_name, static_path, args)

TODO

Parameters:
  • static_name – TODO
  • static_path – TODO
  • args – TODO
addService(service_handler, service_name=None, **kwargs)

TODO

Parameters:
  • service_handler – TODO
  • service_name – TODO
addSiteServices()

TODO

addStatic(static_handler_factory, **kwargs)

TODO

Parameters:service_handler_factory – TODO
build_gnrapp()

Builds the GnrApp associated with this site

build_wsgiapp()

Build the wsgiapp callable wrapping self.dispatcher with WSGI middlewares

callTableScript(page=None, table=None, respath=None, class_name=None, runKwargs=None, **kwargs)

Call a script from a table’s resources (e.g: _resources/tables/<table>/<respath>).

This is typically used to customize prints and batch jobs for a particular installation

Parameters:
  • page – TODO
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • respath – TODO
  • class_name – TODO
  • runKwargs – TODO
cleanup()

clean up

clearRecordLocks(**kwargs)

TODO

client_exception(message, environ)

TODO

Parameters:
  • message – TODO
  • environ – TODO
connectionLog(event, connection_id=None)

TODO

Parameters:
  • event – TODO
  • connection_id – TODO
currentPage

property currentPage it returns the page currently used in this thread

debugger(debugtype, **kwargs)

Send debug information to the client, if debugging is enabled. Press Ctrl+Shift+D to open the debug pane in your browser

Parameters:debugtype – string (values: ‘sql’ or ‘py’)
dispatcher(environ, start_response)

Main WSGI dispatcher, calls serve_staticfile for static files and self.createWebpage for GnrCustomWebPage

Parameters:
  • environ – TODO
  • start_response – TODO
dropConnectionFolder(connection_id=None)

TODO

Parameters:connection_id – TODO
exception(message)

TODO

Parameters:message – TODO
failed_exception(message, environ, start_response, debug_message=None)

TODO

Parameters:
  • message – TODO
  • environ – TODO
  • start_response – add??
  • debug_message – TODO
find_gnrjs_and_dojo()

TODO

forbidden_exception(environ, start_response, debug_message=None)

TODO

Parameters:
  • environ – TODO
  • start_response – add??
  • debug_message – TODO
getPreference(path, pkg='', dflt='')

TODO

Parameters:
  • path – TODO
  • pkg – the package object
  • dflt – TODO
getService(service_name)

TODO

Parameters:service_name – TODO
getStatic(static_name)

TODO

Parameters:static_name – TODO
getStaticPath(static, *args, **kwargs)

TODO

Parameters:static – TODO
getStaticUrl(static, *args, **kwargs)

TODO

Parameters:static – TODO
getUserPreference(path, pkg='', dflt='', username='')

TODO

Parameters:
  • path – TODO
  • pkg – the package object
  • dflt – TODO
  • username – TODO
get_datachanges(page_id, user=None, local_datachanges=None)

TODO

Parameters:
  • page_id – TODO
  • user – the username
  • local_datachanges – TODO
get_path_list(path_info)

TODO

Parameters:path_info – TODO
guest_counter

TODO

handle_clientchanges(page_id=None, parameters=None)

TODO

Parameters:
  • page_id – TODO
  • parameters – TODO
initializePackages()

TODO

loadResource(pkg, *path)

TODO

Parameters:
  • pkg – the package object
  • *path – TODO
loadTableScript(page=None, table=None, respath=None, class_name=None)

TODO

Parameters:
  • page – TODO
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • respath – TODO
  • class_name – TODO
load_gnr_config()

TODO

load_site_config()

TODO

load_webtool(tool_name)

TODO

Parameters:tool_name – the tool name
lockRecord(page, table, pkey)

TODO

Parameters:
  • page – TODO
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • pkey – the record primary key
log_print(msg, code=None)

TODO

Parameters:
  • msg – add??
  • code – TODO
not_found_exception(environ, start_response, debug_message=None)

TODO

Parameters:
  • environ – TODO
  • start_response – add??
  • debug_message – TODO
notifyDbEvent(tblobj, record, event, old_record=None)

TODO

Parameters:
  • tblobj – the table object
  • record – TODO
  • event – TODO
  • old_record – TODO
onAuthenticated(avatar)

TODO

Parameters:avatar – the avatar (user that logs in)
onClosePage(page)

A method called on when a page is closed on the client

Parameters:page – the webpage being closed
onDbCommitted()

TODO

onInited(clean)

TODO

Parameters:clean – TODO
onServedPage(page)

TODO

Parameters:page – TODO
onServingPage(page)

TODO

Parameters:page – TODO
on_reloader_restart()

TODO

pageLog(event, page_id=None)

TODO

Parameters:
  • event – TODO
  • page_id – the 22 characters page id
parse_kwargs(kwargs, workdate=None)

TODO

Parameters:
  • kwargs – the kw arguments
  • workdate – the workdate
parse_request_params(params)

TODO

Parameters:params – TODO
pkg_page_url(pkg, *args)

TODO

Parameters:pkg – the package object
resource_name_to_path(res_id, safe=True)

TODO

Parameters:
  • res_id – TODO
  • safe – boolean. TODO
sendMessageToClient(value, pageId=None, filters=None, origin=None, msg_path=None)

Send a message

Parameters:
  • value – TODO
  • pageId – TODO
  • filters – TODO
  • origin – TODO
  • msg_path – TODO
serve_ping(response, environ, start_response, page_id=None, reason=None, **kwargs)

TODO

Parameters:
  • response – TODO
  • environ – TODO
  • start_response – TODO
  • page_id – TODO
  • reason – TODO
serve_tool(path_list, environ, start_response, **kwargs)

TODO

Parameters:
  • path_list – TODO
  • environ – TODO
  • start_response – TODO
setPreference(path, data, pkg='')

TODO

Parameters:
  • path – TODO
  • data – TODO
  • pkg – the package object
setResultInResponse(result, response, totaltime=None)

TODO

Parameters:
  • result – TODO
  • response – TODO
  • totaltime – TODO
setUserPreference(path, data, pkg='', username='')

TODO

Parameters:
  • path – TODO
  • data – TODO
  • pkg – the package object
  • username – TODO
set_environment()

TODO

shared_data

TODO

siteLock(**kwargs)

TODO

site_static_path(*args, **kwargs)

Warning

deprecated since version 0.7

site_static_url(*args, **kwargs)

Warning

deprecated since version 0.7

unlockRecord(page, table, pkey)

TODO

Parameters:
  • page – TODO
  • table – the database table name on which the query will be executed, in the form packageName.tableName (packageName is the name of the package to which the table belongs to)
  • pkey – the record primary key
webtools_url(tool, **kwargs)

TODO

Parameters:tool – TODO
zipFiles(file_list=None, zipPath=None)

Allow to zip one or more files

Parameters:
  • file_list – a string with the files names to be zipped
  • zipPath – the result path of the zipped file
class gnr.web.gnrwsgisite.SiteLock(site, locked_path, expiry=600)

TODO

acquire()

TODO

release()

TODO

class gnr.web.gnrwsgisite.memoize(capacity=30)

TODO

cached_call()

TODO

reset()

TODO