Table of Contents

Module: base chimera/preferences/base.py

This module consists of three main classes: Preferences, Category and Option. There is also a utility class: HiddenCategory.

Preferences handles the overall tasks of managing the user interface panel, loading and saving preference values to files. It does so by dividing the values into categories, each of which consists of a list of options.

Each option saves three values: the factory "default" value, the per-user "saved" value, and the "current" value. When saving an option value to file, it's the "saved" value that gets written. When operating Chimera, it's the "current" value that determines the program behavior. This separation is important because sometimes the values are different; for example, when a session is loaded, the "current" preference values are set, but not the "saved" values.

HiddenCategory is for simplifying use of Preferences for extensions. To save extension-specific options, the extension can create an instance of HiddenCategory and use it like a dictionary. Any changes to the category is automatically saved. Option values must be "normal" Python types that can be written using repr and recreated via eval.

Imported modules   
import os
import pprint
import sys
Classes   
Category

Category manages a list of options

HiddenCategory
Option

Option is one value managed by a single UI element

Preferences

Preferences manages categories of options.


Table of Contents

This document was automatically generated on Tue Nov 5 16:57:04 2002 by HappyDoc version 2.0.1