hsh :: content :: text :: TextLine :: Class TextLine
[hide private]
[frames] | no frames]

Class TextLine

object --+    
         |    
      list --+
             |
            TextLine

A single line of text within the content, which may have at most one new line as its last character. The line is broken into regions, with each character belonging in exactly one region.

TextLines may have an integer public variable, line_number, useful when folding output to track the original line number. It is not initialized or used internally.

Instance Methods [hide private]
new empty list
__init__(self, init='')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__str__(self)
str(x)
 
_update_regions(self, i, j, seq)
Update the regions of this TextLine for the inserted text.
 
_chk_slice(self, i, j, seq)
 
__setslice__(self, i, j, seq)
x[i:j]=y
 
__setitem__(self, key, val)
x[i]=y
 
append(self, val)
append object to end
 
extend(self, vals)
extend list by appending elements from the iterable
 
insert(self, ind, val)
insert object before index
 
append_region(self, text, attrs=None)
Append a new region to the TextLine, initializing it with the provided text.
 
is_terminated(self)

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __sizeof__, count, index, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, init='')
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns: new empty list
Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

__setslice__(self, i, j, seq)
(Slice assignment operator)

 

x[i:j]=y

Use of negative indices is not supported.

Overrides: list.__setslice__
(inherited documentation)

__setitem__(self, key, val)
(Index assignment operator)

 

x[i]=y

Overrides: list.__setitem__
(inherited documentation)

append(self, val)

 

append object to end

Overrides: list.append
(inherited documentation)

extend(self, vals)

 

extend list by appending elements from the iterable

Overrides: list.extend
(inherited documentation)

insert(self, ind, val)

 

insert object before index

Overrides: list.insert
(inherited documentation)

append_region(self, text, attrs=None)

 

Append a new region to the TextLine, initializing it with the provided text. text may be a string, a TextLineRegion or an array of characters. attrs can be a TextLineRegion or dict specifying attributes to be assigned to the new region.