OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, source) |
def | reset (self) |
def | openStream (self, source) |
def | position (self) |
def | char (self) |
def | readChunk (self, chunkSize=None) |
def | characterErrorsUCS4 (self, data) |
def | characterErrorsUCS2 (self, data) |
def | charsUntil (self, characters, opposite=False) |
def | unget (self, char) |
Data Fields | |
reportCharacterErrors | |
newLines | |
charEncoding | |
dataStream | |
chunk | |
chunkSize | |
chunkOffset | |
errors | |
prevNumLines | |
prevNumCols | |
Provides a unicode stream of characters to the HTMLTokenizer. This class takes care of character encoding and removing or replacing incorrect byte-sequences and also provides column and line tracking.
def __init__ | ( | self, | |
source | |||
) |
Initialises the HTMLInputStream. HTMLInputStream(source, [encoding]) -> Normalized stream from source for use by html5lib. source can be either a file-object, local filename or a string. The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element)
def char | ( | self | ) |
Read one character from the stream or queue if available. Return EOF when EOF is reached.
def characterErrorsUCS2 | ( | self, | |
data | |||
) |
def characterErrorsUCS4 | ( | self, | |
data | |||
) |
def charsUntil | ( | self, | |
characters, | |||
opposite = False |
|||
) |
Returns a string of characters from the stream up to but not including any character in 'characters' or EOF. 'characters' must be a container that supports the 'in' method and iteration over its characters.
def openStream | ( | self, | |
source | |||
) |
Produces a file object from source. source can be either a file object, local filename or a string.
Reimplemented in HTMLBinaryInputStream.
def position | ( | self | ) |
Returns (line, col) of the current position in the stream.
def readChunk | ( | self, | |
chunkSize = None |
|||
) |
def reset | ( | self | ) |
Reimplemented in HTMLBinaryInputStream.
def unget | ( | self, | |
char | |||
) |
charEncoding |
chunk |
chunkOffset |
chunkSize |
dataStream |
errors |
newLines |
prevNumCols |
prevNumLines |
reportCharacterErrors |