Package licensechecker :: Module commentinfo :: Class CommentInfo
[hide private]
[frames] | no frames]

Class CommentInfo

source code

Class storing some information about comment types in various programming languages.

Instance Methods [hide private]
 
__init__(self, typename='Unknown', linecomments=(), blockcomments=())
Builds an instance of CommentInfo.
source code
 
getTypeName(self)
Returns the type name of the current instance.
source code
 
getLineComments(self)
Returns the tuple of line comments of the current instance.
source code
 
getBlockComments(self)
Returns the tuple of tuples of block comments of the current instance.
source code
Method Details [hide private]

__init__(self, typename='Unknown', linecomments=(), blockcomments=())
(Constructor)

source code 

Builds an instance of CommentInfo.

Parameters:
  • typename - a string representing the language this comment info is related to,
  • linecomments - a tuple of strings denoting the way single line comments are represented in a given progamming language,
  • blockcomments - a tuple of tuples denoting how block comments are formatted. Each first-level tuple contains a two-element second-level tuple, where the first element is the string representing opening block comments, and the second element represents closing block comments.

    As an example, a Java CommentInfo could be built as follows :

    >>> ci=CommentInfo('Java',('//',)(('/*','*/'),))