Package licensechecker :: Module licenseinfo :: Class LicenseChecker
[hide private]
[frames] | no frames]

Class LicenseChecker

source code

Class loading license information from a set of files in a template directory.

Instance Methods [hide private]
 
__init__(self, templatedir='/home/mhoebeke/Devel/lichk/src/licensechecker/data/templates')
Builds a new instance of LicenseChecker.
source code
 
addLicense(self, filename)
Adds a license to the list of known licenses.
source code
[LicenseInfo,]
getAllLicenses(self)
Returns information about all known licenses.
source code
[string,]
getLicenseLabels(self)
Returns all known license labels.
source code
LicenseInfo
getLicenseWithLabel(self, label)
Returns the LicenseInfo for a given label.
source code
Method Details [hide private]

__init__(self, templatedir='/home/mhoebeke/Devel/lichk/src/licensechecker/data/templates')
(Constructor)

source code 

Builds a new instance of LicenseChecker.

Parameters:
  • templatedir - the name of a license template directory. In this directory all files ending with .txt will be parsed. If not specified the directory is taken to be the templates subdirectory in this module's data subdirectory. If templatedir=None no directory will be used, and no license information will be initialised.

addLicense(self, filename)

source code 

Adds a license to the list of known licenses.

Parameters:
  • filename - a string with the filename of a license template.

getAllLicenses(self)

source code 

Returns information about all known licenses.

Returns: [LicenseInfo,]
a list of all known LicenseInfo instances.

getLicenseLabels(self)

source code 

Returns all known license labels.

Returns: [string,]
the sorted list of labels of all known licenses.

getLicenseWithLabel(self, label)

source code 

Returns the LicenseInfo for a given label.

Parameters:
  • label - a string with a known license label.
Returns: LicenseInfo
the LicenseInfo instance of the license with the given label or None if the label is unknown.