paradrop.lib package

Submodules

paradrop.lib.chute module

class Chute(descriptor, strip=None)[source]

Bases: object

Wrapper class for Chute objects.

appendCache(key, val)[source]

Finds the key they requested and appends the val into it, this function assumes the cache object is of list type, if the key hasn’t been defined yet then it will set it to an empty list.

delCache(key)[source]

Delete the key:val from the _cache dict object.

dumpCache()[source]

Return a string of the contents of this chute’s cache. In case of catastrophic failure dump all cache content so we can debug.

fullDump()[source]

Return a dump of EVERYTHING in this chute including all API data and all internal cache data.

getCache(key)[source]

Get the val out of the _cache dict object, or None if it doesn’t exist.

isValid()[source]

Return True only if the Chute object we have has all the proper things defined to be in a valid state.

setCache(key, val)[source]

Set the key:val into the _cache dict object to carry around.

paradrop.lib.settings module

This file contains any settings required by ANY and ALL modules of the paradrop system. They are defaulted to some particular value and can be called by any module in the paradrop system with the following code:

from paradrop import settings print(settings.STUFF)

These settings can be overriden by a file defined which contains the following syntax:

# This changes a string default setting EXACT_SETTING_NAME0 “new string setting”

# This changes a int default setting EXACT_SETTING_NAME1 int0

If settings need to be changed, they should be done so by the initialization code (such as pdfcd, pdapi_server, pdfc_config, etc...)

This is done by calling the following function:
settings.updateSettings(filepath)
addSetting(key, value)[source]

Adds a new setting to this module so other modules can see it.

Parameters:
  • key (string.) – the setting name.
  • value (variable.) – the value of the setting.
Returns:

None

parseValue(key)[source]

Attempts to parse the key value, so if the string is ‘False’ it will parse a boolean false.

Parameters:key (string) – the key to parse
Returns:the parsed key.
updateSettings(slist=[])[source]

Take a list of key:value pairs, and replace any setting defined. Also search through the settings module and see if any matching environment variables exist to replace as well.

Parameters:slist (array.) – the list of key:val settings
Returns:None

Module contents