crossbar.webservice.archive

Classes

RouterWebServiceArchive

Static Web from ZIP archive service.

ZipArchiveResource

Twisted Web resource

ZipFileResource

Twisted Web resource for a single file within a ZIP archive.

Functions

_download(reactor, url, destination_filename)

_sha256file(filename[, block_size])

Module Contents

class RouterWebServiceArchive(transport, path, config=None, resource=None)[source]

Bases: crossbar.webservice.base.RouterWebService

Static Web from ZIP archive service.

static check(personality, config)[source]

Checks the configuration item. When errors are found, an InvalidConfigException exception is raised.

Parameters:
  • personality – The node personality class.

  • config – The Web service configuration item.

Raises:

crossbar.common.checkconfig.InvalidConfigException

static create(transport, path, config)[source]

Factory to create a Web service instance of this class.

Parameters:
  • transport – The Web transport in which this Web service is created on.

  • path – The (absolute) URL path on which the Web service is to be attached.

  • config – The Web service configuration item.

Returns:

An instance of this class.

class ZipArchiveResource(worker, config, path, archive_file)[source]

Bases: twisted.web.resource.Resource

Twisted Web resource

_archive_file[source]
_cache[source]
_config[source]
_default_file[source]
_default_object[source]
_object_prefix[source]
_origin[source]
_path[source]
_worker[source]
contentEncodings[source]
contentTypes[source]
getChild(path, request, retry=True)[source]

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

log[source]
class ZipFileResource(file, size, content_type)[source]

Bases: twisted.web.resource.Resource

Twisted Web resource for a single file within a ZIP archive.

encoding = None[source]
file[source]
isLeaf = True[source]
log[source]
render_GET(request)[source]
size[source]
type[source]
_download(reactor, url, destination_filename)[source]
_sha256file(filename, block_size=2**20)[source]