Plex Media Center for OS X Leopard

5.3.1. Dict — Dictionary management

Threading:This module is thread-safe.

Each plug-in has access to a unique dictionary, which is maintained by the framework. The dictionary is automatically saved to a file when necessary, and is always resident in memory, providing fast access times.

TODO: Link to info about CreateDict() and DefaultDict.json

Note

To assist with multithreaded programming, the @modify_dict decorator is provided. See Decorators for more information.

This module defines the following functions:

Dict.Get(key)

Retrieves an item with the given key from the dictionary.

Parameter:key (str) – The key of the item
Returns:The item stored in the dictionary using the given key
Dict.Set(key, value)

Stores an item in the dictionary using the given key.

Parameters:
  • key (str) – The key of the item
  • value (object) – The object to store
Dict.HasKey(key)

Checks whether an item with the given key exists in the dictionary.

Parameter:key (str) – The key of the item
Returns:True if a dictionary item exists with the given key
Return type:bool
Dict.Reset()
Erases the dictionary & repopulates it with the default values (defined in the CreateDict() framework function or the DefaultDict.json file).

Previous topic

5.3. Data storage

Next topic

5.3.2. Data — Simple data storage and retrieval