Package peppy :: Module stcinterface :: Class STCInterface
[frames] | no frames]

Class STCInterface

object --+
         |
        STCInterface
Known Subclasses:

Methods that a data source object must implement in order to be compatible with the real STC used as the data source for text-based files.

See the Yellowbrain guide to the STC for more info on the rest of the STC methods.

Instance Methods
 
AddRefDocument(self, ptr)
 
CanCopy(self)
 
CanCut(self)
 
CanEdit(self)
PyPE compat to show read-only status
 
CanPaste(self)
 
CanRedo(self)
 
CanSave(self)
Can this STC instance save its contents?
 
CanUndo(self)
 
Clear(self)
 
Copy(self)
 
CreateDocument(self)
 
Cut(self)
 
EmptyUndoBuffer(self)
 
GetBinaryData(self, start, end)
 
GetFoldColumn(self, line)
Return column number of folding.
 
GetFoldLevel(self, line)
Return fold level of specified line.
 
GetLength(self)
 
GetModify(self)
 
GetPrevLineIndentation(self, line)
Get the indentation of the line before the specified line.
 
GetText(self)
 
GetTextLength(self)
 
GotoPos(self, pos)
Move the cursor to the specified position and scroll the position into the view if necessary.
 
GuessBinary(self, amount, percentage)
 
Paste(self)
 
Redo(self)
 
ReleaseDocument(self, ptr)
 
SetDocPointer(self, ptr)
 
SetSavePoint(self)
 
Undo(self)
 
getShortDisplayName(self, url)
Return a short name for display in tabs or other context without needing a pathname.
 
open(self, buffer, message=None)
Read from the specified url to populate the STC.
 
openSuccess(self, buffer)
Called after a file has been successfully opened.
 
prepareEncoding(self)
Convert the raw bytes in the file to the correct encoding before writing.
 
readFrom(self, fh)
Read from filehandle, converting as necessary
 
showStyle(self, linenum=None)
Debugging routine to show the styling information on a line.
 
writeTo(self, fh)
Write to filehandle, converting as necessary

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

GetFoldColumn(self, line)

 

Return column number of folding.

Return column number of the current fold level.

GetFoldLevel(self, line)

 

Return fold level of specified line.

Return fold level of line, which seems to be the number of spaces used to indent the line, plus an offset and shifted by 2^10

GetPrevLineIndentation(self, line)

 

Get the indentation of the line before the specified line.

Return a tuple containing the number of columns of indentation of the first non-blank line before the specified line, and the line number of the line that it found.

open(self, buffer, message=None)

 

Read from the specified url to populate the STC.

Abstract method that subclasses use to read data into the STC. May be called from a thread, so don't process any GUI actions here.

buffer: buffer object used to read the file

message: optional message used to update a progress bar

openSuccess(self, buffer)

 

Called after a file has been successfully opened.

This is called by the GUI thread, so can update any GUI elements here.

readFrom(self, fh)

 

Read from filehandle, converting as necessary

Parameters:
  • fh - file-like object used to load the file

showStyle(self, linenum=None)

 

Debugging routine to show the styling information on a line.

Print styling information to stdout to aid in debugging.

writeTo(self, fh)

 

Write to filehandle, converting as necessary

Parameters:
  • fh - file-like object used to write the file