Home | Trees | Indices | Help |
---|
|
Reporter.Reporter --+ | VersionReporter
VersionReporter - Convenience module for creating version reporters from inca.VersionReporter import VersionReporter reporter = VersionReporter() command = 'somecommand -version' pattern = '^version "(.*)"' ... reporter.setPackageName('packageX') reporter.setVersionByExecutable(command, pattern) reporter.printReporter() or reporter.setVersionByGptQuery('packageX') or reporter.setVersionByRpmQuery('packageX') or reporter->setPackageVersion('x.x.x') or for subpackage in subpackages: reporter.setSubpackageVersion(subpackage, version) This module is a subclass of Reporter that provides convenience methods for creating version reporters. A version reporter reports this version information for a package in the following schema (i.e., this is the body of the Inca report): <packageVersion> <ID>packageX</ID> <version>x.x.x</version> </packageVersion> or <packageVersion> <ID>packageX</ID> <subpackage> <ID>subpackageX</ID> <version>x.x.x</version> </subpackage> <subpackage> <ID>subpackageY</ID> <version>x.x.x</version> </subpackage> </packageVersion> Version information can be set using one of the basic methods setPackageVersion (for the first example) or setSubpackageVersion (for the second). In this case, the user retrieves a package's version information directly and uses one of these two methods to report it. This module also provides convenience methods that retrieve a package version using conventional methods of querying version information.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
Class constructor that returns a new VersionReporter object. The constructor supports the following parameters in addition to those supported by Reporter. package_name the name of the package for which a version is being determined; default ''. package_version the version of the package.
|
Constructs and returns the body of the reporter.
|
Retrieve the package version by compiling and running a program and matching its output against a pattern. Returns 1 if successful, else 0. The function recognizes the following parameter in addition to those supported by the compiledProgramOutput method of Reporter: pattern pattern to search for in program output; default '(.+)' |
Retrieve package version information by executing command and greping the output for pattern. command is the executable and argument string to retrieve the version (e.g., command_name -version) and pattern is a pattern containing one grouping (i.e., memory parentheses) to retrieve the version from the output. pattern defaults to '([\d\.]+)' if not specified. Fails if timeout is specified and command does not complete within timeout seconds. Returns 1 if successful, else 0. |
Retrieve the package version by grep'ing the file path for pattern. pattern defaults to '([\d\.]+)' if not specified. Returns 1 if successful, else 0. |
Set subpackage version information by querying GPT for packages prefixed with any element of prefixes. Returns 1 if successful, else 0. |
Set subpackage version information by querying GPT for packages that contain the regular expression pattern. Returns 1 if successful, else 0. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Mar 20 12:01:21 2008 | http://epydoc.sourceforge.net |