gavo.web.syncrender module

The DALI sync renderer.

This is, in principle, trivial and could just go into vodal.

But then there’s sufficiently many hacks in the vicinity of this that a module of its own seems warranted. Also, we’re for now keeping DALIRenderer here, which for now is a no-op only used for registration. This could later become some sort of alias for allowed=”sync,async” defaultRenderer=”info”. But let’s see how the caproles discussion works out.

class gavo.web.syncrender.DALIRenderer(request, service)[source]

Bases: ServiceBasedPage

A meta-renderer for DALI-like multi-renderer services (sync, async, …)

This, for now, can only be used for creating registry records.

classmethod makeAccessURL(basePath)[source]

returns an accessURL for a service with baseURL to this renderer.

name = 'dali'
render(request)[source]

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

class gavo.web.syncrender.SyncRenderer(request, service)[source]

Bases: ServiceBasedPage

a DALI sync renderer.

In principle, this is just a shallow parser of the input parameter and renders tables as VOTables.

In practice, there are a few legacy hacks making this a bit more complicated after all.

name = 'sync'
parameterStyle = 'dali'
render(request)[source]

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

resultType = 'application/x-votable+xml'
urlUse = 'base'