Gversions Class Reference

Version retrieval utility class. More...

List of all members.

Public Member Functions

def getModuleVersions
 Static class method which returns a dictionary of modules with their versions.
def isModuleInReleases
 Method to determine if a loaded module is in the specified list of root directories.
def extractVersion
 Extract the version string from the CVS keyword string.
def calcDigest
 Calculate the digest for a given file.
def getModuleDigests
 Retrieve digests of all loaded modules.
def getReleaseFromDigest
 Given a root directory extract the release tag.
def logBadMarshalDataMessage
 Message that is logged when an exception occurs during the marshalling of the digest data file.
def verifyModuleDigests
 Compare loaded modules and any additional files against the digest data.
def findVersionSymbol
 Find the __version__ symbol in the file.
def verifyFileDigests
 Verify the files under a root directory against the digest data file.
def collectDigests
 Given a path, collect digests from all files.
def printVersions
 Print module versions to the console.

Static Public Attributes

tuple getModuleVersions = staticmethod(getModuleVersions)
tuple isModuleInReleases = staticmethod(isModuleInReleases)
tuple extractVersion = staticmethod(extractVersion)
tuple calcDigest = staticmethod(calcDigest)
tuple getModuleDigests = staticmethod(getModuleDigests)
tuple getReleaseFromDigest = staticmethod(getReleaseFromDigest)
tuple logBadMarshalDataMessage = staticmethod(logBadMarshalDataMessage)
tuple verifyModuleDigests = staticmethod(verifyModuleDigests)
tuple findVersionSymbol = staticmethod(findVersionSymbol)
tuple verifyFileDigests = staticmethod(verifyFileDigests)
tuple collectDigests = staticmethod(collectDigests)
tuple printVersions = staticmethod(printVersions)


Detailed Description

Version retrieval utility class.

Contents:

Provides accessor methods to retrieve version information from both the software and hardware. Displays version info from loaded libraries. Used for troubleshooting problems.

Overview:

Each driver on VxWorks side and each module on the client side provides its version number through functions. When the function cmd.getVersions() is called the command server packetizes this information and sends it over the socket to the command client which gets decoded into a tuple. The getModuleVersions() function converts this tuple to a dictionary and adds the python module versions to it.

Usage:

To retrieve version information one can write:

    python versions.py

    or

    import versions
    versions.Gversions.getModuleVersions()

Definition at line 32 of file gVersions.py.


Member Function Documentation

def calcDigest   filePath  ) 
 

Calculate the digest for a given file.

Parameters:
filePath Full path of the file
Returns:
Digest data.

Definition at line 137 of file gVersions.py.

def collectDigests   path  ) 
 

Given a path, collect digests from all files.

Parameters:
path Root directory
Returns:
Dictionary of digests

Definition at line 363 of file gVersions.py.

def extractVersion   verStr  ) 
 

Extract the version string from the CVS keyword string.

if that's what it appears to be. If it doesn't, just return the input.

Parameters:
verStr CVS keyword string
Returns:
Version string

Definition at line 119 of file gVersions.py.

def findVersionSymbol   filePath  ) 
 

Find the __version__ symbol in the file.

Parameters:
filePath Full path of the module source code
Returns:
Version number or None if not found.

Definition at line 286 of file gVersions.py.

def getModuleDigests  ) 
 

Retrieve digests of all loaded modules.

All modules which do not have __version__ or __file__ attributes are ignored.

Returns:
A dictionary of digest data keyed by module name

Definition at line 156 of file gVersions.py.

def getModuleVersions   lcm = None  ) 
 

Static class method which returns a dictionary of modules with their versions.

Parameters:
lcm LCM instance
Returns:
Dictionary of modules with their versions

Definition at line 35 of file gVersions.py.

def getReleaseFromDigest   digestDataFile = None,
  rootDir = 'LICOS'
 

Given a root directory extract the release tag.

The root directory defaults to LICOS. This method can be used to extract release tag info from sub-system root directories where the digestData file is stored.

Parameters:
digestDataFile The path pointing to the digestData file. If none $ONLINE_ROOT/rootDir/digestData is assumed
rootDir Root directory relative to $ONLINE_ROOT
Returns:
Release tag

Definition at line 179 of file gVersions.py.

def isModuleInReleases   m,
  rootDirs = None
 

Method to determine if a loaded module is in the specified list of root directories.

Parameters:
m Module object
rootDirs List of root directories relative to $ONLINE_ROOT.
Returns:
Boolean that determines whether the module originated from the list of root directories.

Definition at line 95 of file gVersions.py.

def logBadMarshalDataMessage  ) 
 

Message that is logged when an exception occurs during the marshalling of the digest data file.

Definition at line 207 of file gVersions.py.

def printVersions  ) 
 

Print module versions to the console.

Definition at line 421 of file gVersions.py.

def verifyFileDigests   rootDir = 'LICOS',
  digestDataFile = None
 

Verify the files under a root directory against the digest data file.

Parameters:
rootDir Root directory
digestDataFile The path pointing to the digestData file. If none $ONLINE_ROOT/rootDir/digestData is assumed
Returns:
A tuple containing the release tag and a list of module names which failed the verification

Definition at line 321 of file gVersions.py.

def verifyModuleDigests   digestDataFile = None,
  rootDir = 'LICOS',
  additionalFilesToVerify = []
 

Compare loaded modules and any additional files against the digest data.

Parameters:
digestDataFile The path pointing to the digestData file. If none $$ONLINE_ROOT/rootDir/digestData is assumed
rootDir Root directory
additionalFilesToVerify A list of file paths to check
Returns:
A tuple containing the release tag and a list of module names which failed the verification

Definition at line 222 of file gVersions.py.


Member Data Documentation

tuple calcDigest = staticmethod(calcDigest) [static]
 

Definition at line 153 of file gVersions.py.

tuple collectDigests = staticmethod(collectDigests) [static]
 

Definition at line 419 of file gVersions.py.

tuple extractVersion = staticmethod(extractVersion) [static]
 

Definition at line 135 of file gVersions.py.

tuple findVersionSymbol = staticmethod(findVersionSymbol) [static]
 

Definition at line 319 of file gVersions.py.

tuple getModuleDigests = staticmethod(getModuleDigests) [static]
 

Definition at line 177 of file gVersions.py.

tuple getModuleVersions = staticmethod(getModuleVersions) [static]
 

Definition at line 93 of file gVersions.py.

tuple getReleaseFromDigest = staticmethod(getReleaseFromDigest) [static]
 

Definition at line 205 of file gVersions.py.

tuple isModuleInReleases = staticmethod(isModuleInReleases) [static]
 

Definition at line 116 of file gVersions.py.

tuple logBadMarshalDataMessage = staticmethod(logBadMarshalDataMessage) [static]
 

Definition at line 220 of file gVersions.py.

tuple printVersions = staticmethod(printVersions) [static]
 

Definition at line 433 of file gVersions.py.

tuple verifyFileDigests = staticmethod(verifyFileDigests) [static]
 

Definition at line 361 of file gVersions.py.

tuple verifyModuleDigests = staticmethod(verifyModuleDigests) [static]
 

Definition at line 284 of file gVersions.py.


The documentation for this class was generated from the following file:
Generated on Thu Apr 27 20:54:18 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO