Package Integrator :: Module Spiff_Integrator :: Class Package

Class Package



Guard.Resource --+
                 |
                Package

Represents a package in the database.

Instance Methods
Package
__init__(self, name, handle=None, version=None, **kwargs)
You normally shouldn't create an instance yourself; instead, ask the PackageManager to do this for you.
string
__str__(self)
Returns a string in the following format: "handle=version", where "handle" is replaced by the handle of this package and "version" is replaced by the version number.
 
dump(self)
Dumps information regarding the package, such as name, version, author, and description, to stdout.
boolean
matches(self, descriptor)
Returns True if the given descriptor matches the handle and version of this package, False otherwise.
string
get_filename(self)
Returns the filename of this package.
 
set_author(self, author)
Define the author of the package.
string
get_author(self)
Returns the name of the author of this package.
 
set_author_email(self, email)
Define the email address of the author of the package.
string
get_author_email(self)
Returns the email address of the author of this package.
 
set_description(self, description)
Define a description for the package.
string
get_description(self)
Returns a human readable description of the content of this package.
 
set_version(self, version)
Define the version of the package.
string
get_version(self)
Returns the version number of this package.
list[string]
get_dependency_context_list(self)
This function returns a list of all contexts specified by this package.
list[string]
get_dependency_list(self, context=None)
Returns a list of all dependencies specified by this package.
list[string]
get_signal_list(self)
Returns the list of signals that this package may send.
list[string]
get_listener_list(self)
Returns the list of signals to which this package may respond.
string
get_module_dir(self)
Returns the name of the directory in which this package is installed.
object
load(self)
Imports the package, creates an instance, and returns a reference to it.
Method Details

__init__(self, name, handle=None, version=None, **kwargs)
(Constructor)

 
You normally shouldn't create an instance yourself; instead, ask the PackageManager to do this for you.
Parameters:
  • name (string) - The name of the package.
  • handle (string) - The system name of the package.
  • version (string) - The package version.
Returns: Package
The new instance.

__str__(self)
(Informal representation operator)

 
Returns a string in the following format: "handle=version", where "handle" is replaced by the handle of this package and "version" is replaced by the version number.
Returns: string
The handle and version number.

matches(self, descriptor)

 
Returns True if the given descriptor matches the handle and version of this package, False otherwise.
Parameters:
  • descriptor (string) - The description (for example, 'spiff>=0.1').
Returns: boolean
True if the descriptor matches, False otherwise.

get_filename(self)

 
Returns the filename of this package.
Returns: string
The full filename.

set_author(self, author)

 
Define the author of the package.
Parameters:
  • author (string) - The name of the author.

get_author(self)

 
Returns the name of the author of this package.
Returns: string
The name of the author.

set_author_email(self, email)

 
Define the email address of the author of the package.
Parameters:
  • email (string) - The email address.

get_author_email(self)

 
Returns the email address of the author of this package.
Returns: string
The email address.

set_description(self, description)

 
Define a description for the package.
Parameters:
  • description (string) - A description of the package.

get_description(self)

 
Returns a human readable description of the content of this package.
Returns: string
The description.

set_version(self, version)

 
Define the version of the package.
Parameters:
  • version (string) - The version and release number.

get_version(self)

 
Returns the version number of this package.
Returns: string
The version number.

get_dependency_context_list(self)

 
This function returns a list of all contexts specified by this package. Packages may specify multiple "types" of dependencies. For example, a package may specify a dependency that is only needed at install time, and another dependency that is only needed at runtime. In such a case, dependencies are sorted into different contexts and may be named "install_time" and "runtime". The context is specified in the XML index file of a package.
Returns: list[string]
A list of contexts.

get_dependency_list(self, context=None)

 
Returns a list of all dependencies specified by this package. If a context is given, only the dependendencies in this context are returned.
Returns: list[string]
A list of dependency descriptors.

get_signal_list(self)

 
Returns the list of signals that this package may send.
Returns: list[string]
A list of signal URIs.

get_listener_list(self)

 
Returns the list of signals to which this package may respond.
Returns: list[string]
A list of signal URIs.

get_module_dir(self)

 
Returns the name of the directory in which this package is installed.
Returns: string
The full directory name.

load(self)

 
Imports the package, creates an instance, and returns a reference to it. Always returns a reference to the same instance if called multiple times.
Returns: object
The instance of package.