bag.web.pyramid.burla module

Integration of bag.web.burla into Pyramid.

Burla provides powerful URL generation independent of web frameworks.

From this module you can import the variable ops and then use it to register pages and operations with burla.

burla can autogenerate documentation for those registered pages and operations.

Finally, burla can register them as Pyramid views. For this you need to add, to the bottom of your Pyramid initialization, this call:

ops.register_pyramid_views()

TODO: Use the registry instead of a global variable “ops”.

class bag.web.pyramid.burla.PyramidBurla(root='', page_class=<class 'bag.web.burla.Page'>, op_class=<class 'bag.web.burla.Operation'>)[source]

Bases: bag.web.burla.Burla

Subclass of Burla for integration with Pyramid.

op(op_name, section='Miscellaneous', **kw)[source]

Decorator to register an API operation.

Decorate your view handlers with this to register an operation with Burla as well as with Pyramid.

page(op_name, section='Miscellaneous', **kw)[source]

Decorator to register a page.

Decorate your view handlers with this to register a page with Burla as well as with Pyramid.

register_pyramid_views()[source]

Optionally register all those URLs with Pyramid as views, too.

bag.web.pyramid.burla.add_api_doc_view(config, url='/doc_api', **kw)[source]

Add to a Pyramid web app a URL documenting its API.

Return type:None
bag.web.pyramid.burla.add_http_operations_list_url(config, url='/http_operations')[source]

Add a view that returns pages and HTTP operations as JSON.

bag.web.pyramid.burla.add_pages_doc_view(config, url='/doc_pages', **kw)[source]

Add to a Pyramid web app a URL with its site map.

Return type:None
bag.web.pyramid.burla.add_view_for_javascript_file(config, url='/burla')[source]
bag.web.pyramid.burla.includeme(config)[source]

Add 2 URLs to a Pyramid web application.

  • /http_operations: JSON list of endpoints.
  • /burla: Javascript library to generate URLs using the above.