tuple
(<class engine.Element at 0x8602dac>,)
tuple() -> an empty tuple
tuple(sequence) -> tuple initialized from sequence's items
If the argument is a tuple, the return value is the same object.
Method __init__
__init__( self, name, attributes=None )
Undocumented
Method _attributesAsHTML
_attributesAsHTML( self )
Returns the attributes as HTML
Method append
append( self, n )
Undocumented
Method contentAsLines
contentAsLines( self )
Undocumented
Method setMode
setMode( self, mode )
Undocumented
Class Declaration
Undocumented
tuple
()
tuple() -> an empty tuple
tuple(sequence) -> tuple initialized from sequence's items
If the argument is a tuple, the return value is the same object.
Method __init__
__init__( self, name, attributes=None, isInline=False, isPI=False )
Undocumented
Method _attributesAsHTML
_attributesAsHTML( self )
Returns the attributes as HTML
Method append
append( self, n )
Undocumented
Method contentAsLines
contentAsLines( self )
Undocumented
Method setMode
setMode( self, mode )
Undocumented
Class Element
Represents an element within the HTML document.
Method __init__
__init__( self )
Method _ensureNewLine
_ensureNewLine( self )
Ensures that there is a new line.
Method _formatContent
_formatContent( self, element )
Formats the content of the given element. This uses the formatting
operations defined in this class.
Method _formatElement
_formatElement( self, element )
Formats the given element and its content, by using the formatting
operations defined in this class.
Method _inlineCanSpanOneLine
_inlineCanSpanOneLine( self, element )
Tells wether the given element (when considered as an inline) can
span one single line. It can if only it has inlines that can span
one line and text without EOLs as content.
Method _isNewLine
_isNewLine( self )
Tells wether the current line is a new line.
Method _iterateOnWords
_iterateOnWords( self, text )
Splits the given text into words (separated by ' ', ' ' or '
') and
returns an iterator on these words.
This function is used by 'wrapText'.
Method endIndent
endIndent( self )
Undocumented
Method endWriting
endWriting( self )
Undocumented
Method ensureNewLine
ensureNewLine( self )
Undocumented
Method findFlag
findFlag( self, flag )
Finds the level at which the given flag is defined. Returns -1 if it
is not found.
Method format
format( self, document, indent=0 )
Formats the given document, starting at the given indentation (0 by
default).
Method formatText
formatText( self, text )
Returns the given text properly formatted according to
this formatted configuration.
Method getDefaults
getDefaults( self, elementName )
Gets the formatting defaults for the given element name.
Method getFlags
getFlags( self )
Returns the list of defined flags, by order of definition (last flags
are more recent.
Method hasFlag
hasFlag( self, flag )
Tells if the given flag is currently defined.
Method indentAsSpaces
indentAsSpaces( self, indent=None, increment=0 )
Converts the 'indent' value to a string filled with spaces or tabs
depending on the formatter parameters.
Method indentString
indentString( self, text, indent=None, start=True, end=False )
Indents the given 'text' with the given 'value' (which will be
converted to either spaces or tabs, depending on the formatter
parameters.
If 'start' is True, then the start line will be indented as well,
otherwise it won't. When 'end' is True, a newline is inserted at
the end of the resulting text, otherwise not.
Method newLine
newLine( self )
Undocumented
Method normalizeText
normalizeText( self, text )
Replaces the tabs and eols by spaces, ignoring the value of tabs.
Method popFlags
popFlags( self )
Pops the given flags from the flags queue.
Method pushFlags
pushFlags( self, *flags )
Pushes the given flags (as varargs) on the flags queue.
Method reformatText
reformatText( self, text )
Reformats a text so that it fits a particular text width.
Method setDefaults
setDefaults( self, element, formatOptions=() )
Sets the formatting defaults for the given element name.
Method setFlag
setFlag( self, flag )
Method setFlags
setFlags( self, *flags )
Set the given flags, given as varargs.
Method startIndent
startIndent( self )
Undocumented
Method startWriting
startWriting( self )
Undocumented
Method stripText
stripText( self, text )
Strips leading and trailing spaces or eols from this text
Method wrapText
wrapText( self, text, offset=0, textWidth=80, indent=None )
Wraps the given text at the given 'textWidth', starting at the given
'offset' with the given optional 'ident'.
Method writeTag
writeTag( self, tagText )
Undocumented
Method writeText
writeText( self, text )
Undocumented
Class Formatter
Formats the elements of the Pamela object model. A formatter really acts
as a state machine, and keeps track of the various formatting hints bound to
the Pamela XML/HTML elements to render the document in the most appropriate
way.
If you instanciate a formatter, you'll have access to the following
attributes, which can influence the generated text:
- 'indent=0'
- 'indentValue=" "'
- 'textWidth=80'
- 'defaults=HTML_DEFAULT'
Method __init__
__init__( self )
Undocumented
Method _getLineIndent
_getLineIndent( self, line )
Returns the line indentation as a number. It takes into account the
fact that tabs may be requried or not, and also takes into account the
'tabsWith' property.
Method _gotoParentElement
_gotoParentElement( self, currentIndent )
Finds the parent element that has an identation lower than the given
'currentIndent'.
Method _isInEmbed
_isInEmbed( self )
Tells if the current element is an embed element (like
CSS,PHP,etc)
Method _parseContentLine
_parseContentLine( self, line )
Parses a line that is data/text that is part of an element
content.
Method _parseLine
_parseLine( self, line )
Parses the given line of text.
This is an internal method that you should not really use directly.
Method _parsePamelaAttributes
_parsePamelaAttributes( self, attributes )
Parses a string representing Pamela attributes and returns a list of
couples '[name, value]' representing the attributes.
Method _parsePamelaElement
_parsePamelaElement( self, element )
Parses the declaration of a Pamela element, which is like the
following examples:
> html
> title:
> body#main.body(onclick=load)|c:
basically, it is what lies between '<' and the ':' (or '
'), which can
be summmed up as:
> (#ID | NAME #ID?) .CLASS* ATTRIBUTES? |HINTS? :?
where attributes is a command-separated sequence of this, surrounded by
parens:
> NAME=(VALUE|'VALUE'|"VALUE")
This function returns a triple (name, attributes, hints)
representing the parsed element. Attributes are stored as an ordered
list of couples '(name, value'), hints are given as a list of strings.
Method _popStack
_popStack( self )
Undocumented
Method _pushStack
_pushStack( self, indent, type, mode=None )
Undocumented
Method indent
indent( self )
Undocumented
Method parseFile
parseFile( self, path )
Parses the file with the given path, and return the corresponding
HTML document.
Method parseString
parseString( self, text, path=None )
Parses the given string and returns an HTML document.
Method path
path( self )
Returns the current path of the file being parsed, if any
Class Parser
Implements a parser that will turn a Pamela document into an HTML
document, returned as a string.
The main methods that you should use are
- 'parseFile' to parse file identified by the given path
- 'parseString' to parse a string given as parameter
You can configure the parser by using the following methods:
- 'acceptTabsOnly', to tell that the parser will only accept tabs.
- 'acceptSpacesOnly', to tell that the parser will only accept spaces.
- 'acceptTabsAndSpaces', to tell that the parser will accept both tabs and
spaces.
- 'tabsWidth', to specify the width of a tab in spaces, which is only used
when the parser accepts both tabs and spaces.
Method __init__
__init__( self, content )
Undocumented
Method contentAsLines
contentAsLines( self )
Undocumented
Class Text
Reprensents a text fragment within the HTML document.
Method __init__
__init__( self )
Undocumented
Method _node
_node( self )
Undocumented
Method _popStack
_popStack( self )
Undocumented
Method _pushStack
_pushStack( self, node )
Undocumented
Method mode
mode( self )
Undocumented
Method onComment
onComment( self, line )
Undocumented
Method onDeclarationEnd
onDeclarationEnd( self )
Undocumented
Method onDeclarationStart
onDeclarationStart( self, name, attributes=None )
Undocumented
Method onDocumentEnd
onDocumentEnd( self )
Undocumented
Method onDocumentStart
onDocumentStart( self )
Undocumented
Method onElementEnd
onElementEnd( self )
Undocumented
Method onElementStart
onElementStart( self, name, attributes=None, isInline=False )
Undocumented
Method onTextAdd
onTextAdd( self, text )
Adds the given text fragment to the current element.
Method popMode
popMode( self )
Undocumented
Method pushMode
pushMode( self, name )
Undocumented
Class Writer
The Writer class implements a simple SAX-like interface to create the
resulting HTML/XML document. This is not API-compatible with SAX because
Pamela as slightly differnt information than what SAX offers, which requires
specific methods.
Function parse
parse( text, path=None )
Undocumented
Function run
run( arguments, input=None )
Undocumented
str
'c'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'i'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'ib'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'n'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
tuple
('i', 'ib', 'sl', 'p', 'n', 's', 'c')
tuple() -> an empty tuple
tuple(sequence) -> tuple initialized from sequence's items
If the argument is a tuple, the return value is the same object.
str
'p'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'sl'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
's'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'w'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
dict
{'pre': ['p'], 'code': ['n', 's', 'c'], 'p': ['n', 's', 'c', 'w'], 'title': ['sl', 'n', 's'], 'h2': ['sl', 'n', 's'], 'h3': ['sl', 'n', 's'], 'h1': ['sl', 'n', 's'], 'h4': ['sl', 'n', 's'], 'script': ['i'], 'link': ['i'], 'div': ['ib']}
dict() -> new empty dictionary.
dict(mapping) -> new dictionary initialized from a mapping object's
(key, value) pairs.
dict(seq) -> new dictionary initialized as if via:
d = {}
for k, v in seq:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
dict
{'canvas': {'NOT_EMPTY': ' '}, 'span': {'NOT_EMPTY': ' '}, 'textarea': {'NOT_EMPTY': ' '}, 'script': {'NOT_EMPTY': ' '}, 'iframe': {'NOT_EMPTY': ' '}, 'div': {'NOT_EMPTY': ' '}}
dict() -> new empty dictionary.
dict(mapping) -> new dictionary initialized from a mapping object's
(key, value) pairs.
dict(seq) -> new dictionary initialized as if via:
d = {}
for k, v in seq:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
str
'0.4.0'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
SRE_Pattern
Compiled regular expression objects
str
'(\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'\\((\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?(,(\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?)*\\)'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'@\\w+'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'<(\\??([\\w\\d_-]+::)?[\\w\\d_-]+((\\#\\??([\\w\\d_-]+::)?[\\w\\d_-]+|\\.\\??([\\w\\d_-]+::)?[\\w\\d_-]+)+)?|(\\#\\??([\\w\\d_-]+::)?[\\w\\d_-]+|\\.\\??([\\w\\d_-]+::)?[\\w\\d_-]+)+)(\\((\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?(,(\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?)*\\))?(@\\w+)?\\:?'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'(\\#\\??([\\w\\d_-]+::)?[\\w\\d_-]+|\\.\\??([\\w\\d_-]+::)?[\\w\\d_-]+)+'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'\\??([\\w\\d_-]+::)?[\\w\\d_-]+'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'DC'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'EL'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'EM'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Module engine
Undocumented
SRE_Pattern
Compiled regular expression objects
Method reformatText
reformatText( self, text )
Reformats a text so that it fits a particular text width.
SRE_Pattern
Compiled regular expression objects
Method _parsePamelaElement
_parsePamelaElement( self, element )
Parses the declaration of a Pamela element, which is like the
following examples:
> html
> title:
> body#main.body(onclick=load)|c:
basically, it is what lies between '<' and the ':' (or '
'), which can
be summmed up as:
> (#ID | NAME #ID?) .CLASS* ATTRIBUTES? |HINTS? :?
where attributes is a command-separated sequence of this, surrounded by
parens:
> NAME=(VALUE|'VALUE'|"VALUE")
This function returns a triple (name, attributes, hints)
representing the parsed element. Attributes are stored as an ordered
list of couples '(name, value'), hints are given as a list of strings.
str
'\\((\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?(,(\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?)*\\)'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'p'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method onComment
onComment( self, line )
Undocumented
Method pushMode
pushMode( self, name )
Undocumented
Method __init__
__init__( self, content )
Undocumented
Method _gotoParentElement
_gotoParentElement( self, currentIndent )
Finds the parent element that has an identation lower than the given
'currentIndent'.
SRE_Pattern
Compiled regular expression objects
Method __init__
__init__( self )
Undocumented
Method _getLineIndent
_getLineIndent( self, line )
Returns the line indentation as a number. It takes into account the
fact that tabs may be requried or not, and also takes into account the
'tabsWith' property.
Method startWriting
startWriting( self )
Undocumented
Method stripText
stripText( self, text )
Strips leading and trailing spaces or eols from this text
Method setFlags
setFlags( self, *flags )
Set the given flags, given as varargs.
Method startIndent
startIndent( self )
Undocumented
Method writeText
writeText( self, text )
Undocumented
Class Parser
Implements a parser that will turn a Pamela document into an HTML
document, returned as a string.
The main methods that you should use are
- 'parseFile' to parse file identified by the given path
- 'parseString' to parse a string given as parameter
You can configure the parser by using the following methods:
- 'acceptTabsOnly', to tell that the parser will only accept tabs.
- 'acceptSpacesOnly', to tell that the parser will only accept spaces.
- 'acceptTabsAndSpaces', to tell that the parser will accept both tabs and
spaces.
- 'tabsWidth', to specify the width of a tab in spaces, which is only used
when the parser accepts both tabs and spaces.
Method wrapText
wrapText( self, text, offset=0, textWidth=80, indent=None )
Wraps the given text at the given 'textWidth', starting at the given
'offset' with the given optional 'ident'.
Method writeTag
writeTag( self, tagText )
Undocumented
Method normalizeText
normalizeText( self, text )
Replaces the tabs and eols by spaces, ignoring the value of tabs.
Method popFlags
popFlags( self )
Pops the given flags from the flags queue.
Method indentString
indentString( self, text, indent=None, start=True, end=False )
Indents the given 'text' with the given 'value' (which will be
converted to either spaces or tabs, depending on the formatter
parameters.
If 'start' is True, then the start line will be indented as well,
otherwise it won't. When 'end' is True, a newline is inserted at
the end of the resulting text, otherwise not.
Method newLine
newLine( self )
Undocumented
Method setDefaults
setDefaults( self, element, formatOptions=() )
Sets the formatting defaults for the given element name.
Method setFlag
setFlag( self, flag )
Method pushFlags
pushFlags( self, *flags )
Pushes the given flags (as varargs) on the flags queue.
Method _parseContentLine
_parseContentLine( self, line )
Parses a line that is data/text that is part of an element
content.
Method format
format( self, document, indent=0 )
Formats the given document, starting at the given indentation (0 by
default).
Method formatText
formatText( self, text )
Returns the given text properly formatted according to
this formatted configuration.
Method findFlag
findFlag( self, flag )
Finds the level at which the given flag is defined. Returns -1 if it
is not found.
Method hasFlag
hasFlag( self, flag )
Tells if the given flag is currently defined.
Method indentAsSpaces
indentAsSpaces( self, indent=None, increment=0 )
Converts the 'indent' value to a string filled with spaces or tabs
depending on the formatter parameters.
Method getDefaults
getDefaults( self, elementName )
Gets the formatting defaults for the given element name.
Method getFlags
getFlags( self )
Returns the list of defined flags, by order of definition (last flags
are more recent.
Method ensureNewLine
ensureNewLine( self )
Undocumented
Method endIndent
endIndent( self )
Undocumented
Method endWriting
endWriting( self )
Undocumented
Method _popStack
_popStack( self )
Undocumented
Method _ensureNewLine
_ensureNewLine( self )
Ensures that there is a new line.
Method _formatContent
_formatContent( self, element )
Formats the content of the given element. This uses the formatting
operations defined in this class.
Class Formatter
Formats the elements of the Pamela object model. A formatter really acts
as a state machine, and keeps track of the various formatting hints bound to
the Pamela XML/HTML elements to render the document in the most appropriate
way.
If you instanciate a formatter, you'll have access to the following
attributes, which can influence the generated text:
- 'indent=0'
- 'indentValue=" "'
- 'textWidth=80'
- 'defaults=HTML_DEFAULT'
Method __init__
__init__( self )
Method _isNewLine
_isNewLine( self )
Tells wether the current line is a new line.
Method _iterateOnWords
_iterateOnWords( self, text )
Splits the given text into words (separated by ' ', ' ' or '
') and
returns an iterator on these words.
This function is used by 'wrapText'.
Method _formatElement
_formatElement( self, element )
Formats the given element and its content, by using the formatting
operations defined in this class.
Method _inlineCanSpanOneLine
_inlineCanSpanOneLine( self, element )
Tells wether the given element (when considered as an inline) can
span one single line. It can if only it has inlines that can span
one line and text without EOLs as content.
tuple
()
tuple() -> an empty tuple
tuple(sequence) -> tuple initialized from sequence's items
If the argument is a tuple, the return value is the same object.
Method setMode
setMode( self, mode )
Undocumented
Class Element
Represents an element within the HTML document.
Method contentAsLines
contentAsLines( self )
Undocumented
Method setMode
setMode( self, mode )
Undocumented
Method _attributesAsHTML
_attributesAsHTML( self )
Returns the attributes as HTML
Method append
append( self, n )
Undocumented
Class Declaration
Undocumented
tuple
(<class engine.Element at 0x8602dac>,)
tuple() -> an empty tuple
tuple(sequence) -> tuple initialized from sequence's items
If the argument is a tuple, the return value is the same object.
Module engine
Undocumented
Method append
append( self, n )
Undocumented
Method contentAsLines
contentAsLines( self )
Undocumented
Method __init__
__init__( self, name, attributes=None )
Undocumented
Method parseString
parseString( self, text, path=None )
Parses the given string and returns an HTML document.
Class Writer
The Writer class implements a simple SAX-like interface to create the
resulting HTML/XML document. This is not API-compatible with SAX because
Pamela as slightly differnt information than what SAX offers, which requires
specific methods.
str
'ib'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method _pushStack
_pushStack( self, indent, type, mode=None )
Undocumented
str
'<(\\??([\\w\\d_-]+::)?[\\w\\d_-]+((\\#\\??([\\w\\d_-]+::)?[\\w\\d_-]+|\\.\\??([\\w\\d_-]+::)?[\\w\\d_-]+)+)?|(\\#\\??([\\w\\d_-]+::)?[\\w\\d_-]+|\\.\\??([\\w\\d_-]+::)?[\\w\\d_-]+)+)(\\((\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?(,(\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?)*\\))?(@\\w+)?\\:?'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
's'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
SRE_Pattern
Compiled regular expression objects
Method __init__
__init__( self, name, attributes=None, isInline=False, isPI=False )
Undocumented
Method onDeclarationStart
onDeclarationStart( self, name, attributes=None )
Undocumented
Function parse
parse( text, path=None )
Undocumented
Function run
run( arguments, input=None )
Undocumented
dict
{'canvas': {'NOT_EMPTY': ' '}, 'span': {'NOT_EMPTY': ' '}, 'textarea': {'NOT_EMPTY': ' '}, 'script': {'NOT_EMPTY': ' '}, 'iframe': {'NOT_EMPTY': ' '}, 'div': {'NOT_EMPTY': ' '}}
dict() -> new empty dictionary.
dict(mapping) -> new dictionary initialized from a mapping object's
(key, value) pairs.
dict(seq) -> new dictionary initialized as if via:
d = {}
for k, v in seq:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
SRE_Pattern
Compiled regular expression objects
str
'(\\??([\\w\\d_-]+::)?[\\w\\d_-]+)(=(\'[^\']+\'|"[^"]+"|([^),]+)))?'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method _parsePamelaAttributes
_parsePamelaAttributes( self, attributes )
Parses a string representing Pamela attributes and returns a list of
couples '[name, value]' representing the attributes.
Method mode
mode( self )
Undocumented
str
'w'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'DC'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'EM'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Class Text
Reprensents a text fragment within the HTML document.
Method _attributesAsHTML
_attributesAsHTML( self )
Returns the attributes as HTML
str
'c'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method onDocumentEnd
onDocumentEnd( self )
Undocumented
Method _isInEmbed
_isInEmbed( self )
Tells if the current element is an embed element (like
CSS,PHP,etc)
SRE_Pattern
Compiled regular expression objects
tuple
('i', 'ib', 'sl', 'p', 'n', 's', 'c')
tuple() -> an empty tuple
tuple(sequence) -> tuple initialized from sequence's items
If the argument is a tuple, the return value is the same object.
Method __init__
__init__( self )
Undocumented
Method parseFile
parseFile( self, path )
Parses the file with the given path, and return the corresponding
HTML document.
str
'\\??([\\w\\d_-]+::)?[\\w\\d_-]+'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
SRE_Pattern
Compiled regular expression objects
Method contentAsLines
contentAsLines( self )
Undocumented
Method onDocumentStart
onDocumentStart( self )
Undocumented
str
'i'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
str
'@\\w+'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method _popStack
_popStack( self )
Undocumented
Method _node
_node( self )
Undocumented
Bases
Methods
Inhertied Methods
SRE_Pattern
Compiled regular expression objects
Method onDeclarationEnd
onDeclarationEnd( self )
Undocumented
Method onElementStart
onElementStart( self, name, attributes=None, isInline=False )
Undocumented
dict
{'pre': ['p'], 'code': ['n', 's', 'c'], 'p': ['n', 's', 'c', 'w'], 'title': ['sl', 'n', 's'], 'h2': ['sl', 'n', 's'], 'h3': ['sl', 'n', 's'], 'h1': ['sl', 'n', 's'], 'h4': ['sl', 'n', 's'], 'script': ['i'], 'link': ['i'], 'div': ['ib']}
dict() -> new empty dictionary.
dict(mapping) -> new dictionary initialized from a mapping object's
(key, value) pairs.
dict(seq) -> new dictionary initialized as if via:
d = {}
for k, v in seq:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
SRE_Pattern
Compiled regular expression objects
Method _parseLine
_parseLine( self, line )
Parses the given line of text.
This is an internal method that you should not really use directly.
SRE_Pattern
Compiled regular expression objects
Method onElementEnd
onElementEnd( self )
Undocumented
str
'sl'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method path
path( self )
Returns the current path of the file being parsed, if any
str
'EL'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method onTextAdd
onTextAdd( self, text )
Adds the given text fragment to the current element.
str
'0.4.0'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method _pushStack
_pushStack( self, node )
Undocumented
str
'n'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method popMode
popMode( self )
Undocumented
SRE_Pattern
Compiled regular expression objects
str
'(\\#\\??([\\w\\d_-]+::)?[\\w\\d_-]+|\\.\\??([\\w\\d_-]+::)?[\\w\\d_-]+)+'
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Method indent
indent( self )
Undocumented