Package licensechecker :: Module commentextractor :: Class CommentHeader
[hide private]
[frames] | no frames]

Class CommentHeader

source code

Class storing infomrmation about the actuel contents of a comment block and it's delimiters.

Instance Methods [hide private]
 
__init__(self, contents, linedelimiter, blockdelimiters, start, end)
Builds a new instance of a CommentHeader.
source code
[string,]
getContents(self)
Returns the contents of the comment header.
source code
string
getLineDelimiter(self)
Returns the line delimiter of the comment header.
source code
[string,string]
getBlockDelimiters(self)
Returns the block delimiter of the comment header.
source code
integer.
getStart(self)
Returns the first line of the comment header in the file.
source code
integer.
getEnd(self)
Returns the last line of the comment header in the file.
source code
Method Details [hide private]

__init__(self, contents, linedelimiter, blockdelimiters, start, end)
(Constructor)

source code 

Builds a new instance of a CommentHeader.

Parameters:
  • contents - a list of strings, where each component is a single line of the comment header.
  • linedelimiter - a string with the delimiter that was used for the commentblock if it was a line comment, otherwise None.
  • blockdelimiters - a tuple of two strings with the opening and closing delimiters if the comment header was block-formatted, otherwise None
  • start - the line number in the file where the comment header started.
  • end - the line number in the file where the comment header stopped.

getContents(self)

source code 

Returns the contents of the comment header.

Returns: [string,]
a list of strings containing the lines of the comment header.

getLineDelimiter(self)

source code 

Returns the line delimiter of the comment header.

Returns: string
a string containing the line delimiter of the comment header (or None).

getBlockDelimiters(self)

source code 

Returns the block delimiter of the comment header.

Returns: [string,string]
a list of two strings containing the opening and closing delimiters of the comment header (or None).

getStart(self)

source code 

Returns the first line of the comment header in the file.

Returns: integer.
the line number where the comment header starts (numbering starts at 1).

getEnd(self)

source code 

Returns the last line of the comment header in the file.

Returns: integer.
the line number where the comment header ends (numbering starts at 1).