handler
Revit-aware event handler.
Attributes
mlogger = get_logger(__name__)
module-attribute
ARGS_REQUEST = 'request'
module-attribute
ARGS_UIAPP = 'uiapp'
module-attribute
ARGS_UIDOC = 'uidoc'
module-attribute
ARGS_DOC = 'doc'
module-attribute
RESERVED_VAR_NAMES = [ARGS_REQUEST, ARGS_UIAPP]
module-attribute
Classes
RequestHandler
Bases: IExternalEventHandler
Revit external event handler type.
Attributes
request
property
writable
Get registered request.
handler
property
writable
Get registered handler.
response
property
Get registered response.
done
property
Check if execution of handler is completed and response is set.
Functions
reset()
join()
Allow other threads to call this method and wait for completion.
run_handler(handler, kwargs)
staticmethod
Execute the handler function and return base.Response.
Source code in pyrevitlib/pyrevit/routes/server/handler.py
make_callback(callback_url, response)
staticmethod
Prepare request from base.Response and submit to callback url.
Source code in pyrevitlib/pyrevit/routes/server/handler.py
wants_api_context(handler)
staticmethod
Check if handler needs host api context.
prepare_handler_kwargs(request, handler, uiapp=None)
staticmethod
Prepare call arguments for handler function.
Source code in pyrevitlib/pyrevit/routes/server/handler.py
parse_response(response)
staticmethod
Parse any given response data and return Response object.
Source code in pyrevitlib/pyrevit/routes/server/handler.py
Execute(uiapp)
This method is called to handle the external event.