Package flumotion :: Package common :: Module common
[hide private]

Module common

source code

small common functions used by all processes


Version: $Rev: 7096 $

Classes [hide private]
  InitMixin
A mixin class to help with object initialization.
Functions [hide private]
 
version(binary)
Print a version block for the flumotion binaries.
source code
 
ensureDir(directory, description)
Ensure the given directory exists, creating it if not.
source code
 
componentPath(componentName, parentName)
Create a path string out of the name of a component and its parent.
source code
str
componentId(parentName, componentName)
Create a componentId based on the parentName and componentName.
source code
tuple of (str, str)
parseComponentId(componentId)
Parses a component id ("/flowName/componentName") into its parts.
source code
str
feedId(componentName, feedName)
Create a feedId based on the componentName and feedName.
source code
tuple of (str, str)
parseFeedId(feedId)
Returns: tuple of (componentName, feedName)
source code
str
fullFeedId(flowName, componentName, feedName)
Create a fullFeedId based on the flowName, componentName and feedName.
source code
tuple of (str, str, str)
parseFullFeedId(fullFeedId)
Returns: tuple of (flowName, componentName, feedName)
source code
 
objRepr(object)
Return a string giving the fully qualified class of the given object.
source code
 
pathToModuleName(path)
Convert the given (relative) path to the python module it would have to be imported as.
source code
int
compareVersions(first, second)
Compares two version strings.
source code
 
checkVersionsCompat(version, against)
Checks if two versions are compatible.
source code
str
versionTupleToString(versionTuple)
Converts a version tuple to a string.
source code
 
_uniq(l, key=<function <lambda> at 0x83b92cc>)
Filters out duplicate entries in a list.
source code
 
get_all_methods(obj, method, subclass_first) source code
 
call_each_method(obj, method, *args, **kwargs)
Invoke all implementations of a method on an object.
source code
 
call_each_method_reversed(obj, method, *args, **kwargs)
Invoke all implementations of a method on an object.
source code
 
strToBool(string)
Returns: True if the string represents a value we interpret as true.
source code
 
assertSSLAvailable()
Assert that twisted has support for SSL connections.
source code
Function Details [hide private]

version(binary)

source code 

Print a version block for the flumotion binaries.

Parameters:
  • binary (string) - name of the binary

ensureDir(directory, description)

source code 

Ensure the given directory exists, creating it if not.

Raises:

componentPath(componentName, parentName)

source code 

Create a path string out of the name of a component and its parent.

Deprecated: Use @componentId instead

componentId(parentName, componentName)

source code 

Create a componentId based on the parentName and componentName.

A componentId uniquely identifies a component within a planet.

Returns: str

Since: 0.3.1

parseComponentId(componentId)

source code 

Parses a component id ("/flowName/componentName") into its parts.

Returns: tuple of (str, str)
tuple of (flowName, componentName)

Since: 0.3.1

feedId(componentName, feedName)

source code 

Create a feedId based on the componentName and feedName.

A feedId uniquely identifies a feed within a flow or atmosphere. It identifies the feed from a feeder to an eater.

Returns: str

Since: 0.3.1

parseFeedId(feedId)

source code 
Returns: tuple of (str, str)
tuple of (componentName, feedName)

Since: 0.3.1

fullFeedId(flowName, componentName, feedName)

source code 

Create a fullFeedId based on the flowName, componentName and feedName.

A fullFeedId uniquely identifies a feed within a planet.

Returns: str

Since: 0.3.1

parseFullFeedId(fullFeedId)

source code 
Returns: tuple of (str, str, str)
tuple of (flowName, componentName, feedName)

Since: 0.3.1

pathToModuleName(path)

source code 

Convert the given (relative) path to the python module it would have to be imported as.

Return None if the path is not a valid python module

compareVersions(first, second)

source code 

Compares two version strings. Returns -1, 0 or 1 if first is smaller than, equal to or larger than second.

Parameters:
  • second (str)
  • first (str)
Returns: int

checkVersionsCompat(version, against)

source code 

Checks if two versions are compatible.

Versions are compatible if they are from the same minor release. In addition, unstable (odd) releases are treated as compatible with their subsequent stable (even) releases.

Parameters:
  • version (tuple of int) - version to check
  • against (tuple of int) - version against which we are checking. For versions of core Flumotion, this may be obtained by flumotion.configure.configure.version.
Returns:
True if a configuration from version is compatible with against.

versionTupleToString(versionTuple)

source code 

Converts a version tuple to a string. If the tuple has a zero nano number, it is dropped from the string.

Parameters:
  • versionTuple (tuple)
Returns: str

Since: 0.4.1

call_each_method(obj, method, *args, **kwargs)

source code 

Invoke all implementations of a method on an object.

Searches for method implementations in the object's class and all of the class' superclasses. Calls the methods in method resolution order, which goes from subclasses to superclasses.

call_each_method_reversed(obj, method, *args, **kwargs)

source code 

Invoke all implementations of a method on an object.

Like call_each_method, but calls the methods in reverse method resolution order, from superclasses to subclasses.

strToBool(string)

source code 
Parameters:
  • string (str)
Returns:
True if the string represents a value we interpret as true.