Package up2date_client :: Module capabilities :: Class Capabilities
[hide private]
[frames] | no frames]

Class Capabilities

source code


Instance Methods [hide private]
 
__init__(self) source code
 
populate(self, headers) source code
 
parseCapVersion(self, versionString) source code
 
validateCap(self, cap, capvalue) source code
 
validate(self) source code
 
setConfig(self, key, configItem) source code
 
workaroundMissingCaps(self) source code
 
hasCapability(self, capability, version=None)
Checks if the server supports a capability and optionally a version.
source code

Inherited from UserDict.UserDict: __cmp__, __contains__, __delitem__, __getitem__, __len__, __repr__, __setitem__, clear, copy, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Class Methods [hide private]

Inherited from UserDict.UserDict: fromkeys

Class Variables [hide private]

Inherited from UserDict.UserDict: __hash__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Overrides: UserDict.UserDict.__init__

hasCapability(self, capability, version=None)

source code 

Checks if the server supports a capability and optionally a version. Returns True or False.

This complements the neededCaps mechanism provided by this module. Using hasCapability makes it easier to do something only if the server supports it or to put workaround code in the user of this class. The neededCaps mechanism makes it easier to put workaround code in this module, which makes sense if it is to be shared.

'capability' should be a string such as 'registration.foobar'. It can be a capability in 'neededCaps' above or one that isn't there. 'version' can be a string (where isdigit() is True) or an int.