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

Class LicenseInfo

source code

Class holding license descriptions.

Instance Methods [hide private]
 
__init__(self, filename)
Builds a new LicenseInfo instance from a license template file.
source code
string
getLabel(self)
Returns the label of this LicenseInfo instance.
source code
string
getDescription(self)
Returns the description of this LicenseInfo instance.
source code
[string,]
getPropertyNames(self)
Returns the proprty names found in the text of this license.
source code
 
__buildFromFile(self, filename) source code
Class Variables [hide private]
  __logger = logging.getLogger('lichk')
Method Details [hide private]

__init__(self, filename)
(Constructor)

source code 

Builds a new LicenseInfo instance from a license template file.

License template files a formatted as follows :

  • the first line contains the 'label: ' keyword followed by single word label for the license,
  • the second line contains the 'description: ' keyword followed by a short description of the license,
  • the third line contains only the 'contents: ' keyword,
  • all subsequent lines are considered to be the text of the license itself.

Inside the license text, constructs of the form ${propname} denote properties. They are replaced with their actuel values when license headers are generated in source files.

Parameters:
  • filename - the name of the license template file.

getLabel(self)

source code 

Returns the label of this LicenseInfo instance.

Returns: string
the label defined for the license held by this LicenseInfo.

getDescription(self)

source code 

Returns the description of this LicenseInfo instance.

Returns: string
the description defined for the license held by this LicenseInfo.

getPropertyNames(self)

source code 

Returns the proprty names found in the text of this license.

Returns: [string,]
a list of properties found when parsing the license template file.