Package park :: Package util :: Module configure :: Class Registry

Class Registry

source code


Instance Methods
 
__init__(self, config)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
add(self, key, value, parser=None, **kw)
Add an entry into the registry.
source code
 
load(self, key)
Parse the config files, setting the defaults.
source code
 
save(self, key)
Save current settings to a config file.
source code
 
host(self, key, value, **kw)
Specify user:password@host:port
source code
 
url(self, key, value, *kw)
Specify a URL.
source code
 
set(self, key, value, **kw)
Parse a set of values separated by spaces.
source code
 
str(self, key, value, **kw)
Parse a string.
source code
 
int(self, key, value, **kw)
Parse an integer.
source code
 
item(self, key, value, choices=None, **kw)
Item chosen from a closed set.
source code
 
list(self, key, value, **kw)
Parse a list.
source code
 
expr(self, key, value, **kw)
Parse a value which may be an expression.
source code
 
units(self, key, value, dim=None, **kw)
Parse a value with units.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, config)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

add(self, key, value, parser=None, **kw)

source code 

Add an entry into the registry.

key is a dotted name forming a hierarchical namespace value is the default If 'after' is given, the configured value only applies after

load(self, key)

source code 

Parse the config files, setting the defaults.

Key should be 'app.org.blah' where app is the name of the application, org is the name of the organization and app.org.blah is your primary application URL.

Configuration will be loaded from /etc/org/apprc and ~/.org/apprc

url(self, key, value, *kw)

source code 
Specify a URL. Returns a urlparse.urlparse object.