class
ScriptTextualObject.
ScriptTextualObjectMarker
Bases: object
All tree objects get amended with this marker.
3.5.6.0
has_textual_declaration
Gets a value indicating whether this ScriptObject has a textual declaration part.
bool
True if it has a textual declaration; otherwise False.
has_textual_implementation
Gets a value indicating whether this ScriptObject has a textual implementation part.
bool
True if it has a textual implementation; otherwise False.
class
ScriptTextualObject.
ScriptTextDocument
Bases: object
Interface for a text document, as it is used e. G. in textual declaration and implementation parts.
Line endings ('\n', '\r', '\r\n') are normalized to '\n'. Lines do not include the line ending character. The first character has offset 0, the first line has lineno 0.
3.5.6.0
length
Gets the length of the text document in bytes.
int
linecount
Gets the number of lines in the current text document.
Line endings ('\n', '\r', '\r\n') are normalized to '\n'. Lines do not include the line ending character. The first line has lineno 0.
int
text
Gets the complete text as a string.
str
get_line
lineno
Gets the line with the specified lineno.
Lines do not include the line ending character. The first line has lineno 0.
lineno (int) -- The line number.
str
The line.
get_text
length
offset=None
lineno=None
lineoffset=None
Gets the text.
WARNING | |
---|---|
get_text(self, offset, length) (1/2)
Gets the text at the specified offset.
str
get_text(self, lineno, lineoffset, length) (2/2)
Gets the text at the specified lineno.
lineoffset (int) -- The offset within the line.
str
replace_line
lineno
line
Replaces the complete line with the specified line number with the new text.
This method retains the position info of the text lines which are not modified.
append
text
Appends the specified text at the end of the buffer.
This method retains the position info of the text lines which are not modified.
text (str) -- The text.
insert
text
offset=None
lineno=None
lineoffset=None
Insert text.
WARNING | |
---|---|
insert(self, offset, text) (1/2)
Inserts the text at the specified offset.
This method retains the position info of the text lines which are not modified.
insert(self, lineno, lineoffset, text) (2/2)
Inserts the text at the offset of the specified line.
This method retains the position info of the text lines which are not modified.
lineoffset (int) -- The offset within the line.
str
remove
length
offset=None
lineno=None
lineoffset=None
Remove text.
WARNING | |
---|---|
remove(self, offset, length) (1/2)
Removes the text at the specified offset.
This method retains the position info of the text lines which are not modified.
remove(self, lineno, lineoffset, length) (2/2)
Removes the text at the specified offset of the specified line.
This method retains the position info of the text lines which are not modified.
lineoffset (int) -- The offset within the line.
replace
new_text=None
newtext=None
length=None
offset=None
lineno=None
lineoffset=None
Replace text.
WARNING | |
---|---|
replace(self, offset, length, newtext) (1/3)
Removes the text at the specified offset.
This method retains the position info of the text lines which are not modified.
newtext (str) -- The new text.
replace(self, lineno, lineoffset, length, newtext) (2/3)
Removes the text at the specified offset of the specified line.
This method retains the position info of the text lines which are not modified.
lineoffset (int) -- The offset within the line.
newtext (str) -- The new text.
replace (self, new_text) (3/3)
Sets the specified new text.
This method erases the position info (used for bookmarks etc).
new_text (str) -- The new text.
class
ScriptTextualObject.
ScriptObjectWithTextualDeclaration
Bases: ScriptTextualObject.ScriptTextualObjectMarker
Accessor interface for textual declaration parts.
3.5.6.0
textual_declaration
Gets the textual declaration.
class
ScriptTextualObject.
ScriptObjectWithTextualImplementation
Bases: ScriptTextualObject.ScriptTextualObjectMarker
Accessor interface for textual implementation parts.
3.5.6.0
textual_implementation
Gets the textual implementation.