API Documentation

Core Dox Wallet Module (tendril.dox.wallet)

This module provides a simple wallet for ‘standard’ documents. These documents would typically be stored within the tendril.config.DOCUMENT_WALLET_ROOT, and defined by the tendril.config.DOCUMENT_WALLET dictionary. Each key, value pair in the dictionary is a key, filename pair.

This module is intended to be used by other tendril.dox modules to provide document sets that include standard documents such as scanned IDs, certificates, so on.

Functions

get_document_path(key)

Returns the absolute path to the document in the wallet referred to by the key.

is_in_wallet(fpath)

Checks whether a specified path points to a document in the wallet.

tendril.dox.wallet._wallet_init()[source]
tendril.dox.wallet.get_document_path(key)[source]

Returns the absolute path to the document in the wallet referred to by the key.

If the wallet fs root is not an OS filesystem, then it copies the wallet document into the temporary folder and returns the path to it.

Parameters

key – Key of the document you want.

Returns

The absolute path to the document.

tendril.dox.wallet.is_in_wallet(fpath)[source]

Checks whether a specified path points to a document in the wallet. This function only checks whether the path is within the tendril.config.DOCUMENT_WALLET_ROOT, and not whether the document is defined in the tendril.config.DOCUMENT_WALLET dictionary.

The intended use of this function is alongside PDF merge operations after which the sources are deleted. Documents in the wallet should not be deleted. Code performing the deletion can use this function to check whether the document is in the wallet.

Parameters

fpath – The path to the file.

Returns

True if the document is in the wallet, False if not.

Related Configuration Options

tendril.config.wallet.load(manager)[source]