ulif.openoffice.wsgi – WSGI RESTful document converter

RESTful WSGI app

class ulif.openoffice.wsgi.FileIterable(filename, start=0, stop=None)

A webob compatible file iterable.

start and stop tell where to start/stop reading. This iterable reads files in chunks to reduce memory load when reading large files.

Supports streaming ranges.

Cf. http://docs.webob.org/en/latest/file-example.html

class ulif.openoffice.wsgi.FileIterator(filename, start=0, stop=None)

An iterator that reads files and returns them in chunks.

The absolute start/stop position in the file can be passed optionally. Used by FileIterable to return streamed files.

Cf. http://docs.webob.org/en/latest/file-example.html

chunk_size = 4096

Size of chunks read when processing files.

class ulif.openoffice.wsgi.RESTfulDocConverter(cache_dir=None)

A WSGI app that caches and converts office documents via LibreOffice.

It acts as a RESTful document store that supports HTTP actions to add/modify/retrieve converted documents.

Accepted arguments:

  • cache_dir:

    Path to a directory, where cached files can be stored. The directory is created if it does not exist.

cache_manager = None

A cache manager instance.

ulif.openoffice.wsgi.docconverter_app

alias of RESTfulDocConverter