Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
idlelib.EditorWindow.IndentSearcher Class Reference
Inheritance diagram for idlelib.EditorWindow.IndentSearcher:
Inheritance graph
[legend]
Collaboration diagram for idlelib.EditorWindow.IndentSearcher:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def readline
def tokeneater
def run

Public Attributes

 text
 tabwidth
 i
 finished
 blkopenline
 indentedline
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 1488 of file EditorWindow.py.


Constructor & Destructor Documentation

def idlelib.EditorWindow.IndentSearcher.__init__ (   self,
  text,
  tabwidth 
)

Definition at line 1495 of file EditorWindow.py.

01495 
01496     def __init__(self, text, tabwidth):
01497         self.text = text
01498         self.tabwidth = tabwidth
01499         self.i = self.finished = 0
01500         self.blkopenline = self.indentedline = None

Here is the caller graph for this function:


Member Function Documentation

Definition at line 1501 of file EditorWindow.py.

01501 
01502     def readline(self):
01503         if self.finished:
01504             return ""
01505         i = self.i = self.i + 1
01506         mark = repr(i) + ".0"
01507         if self.text.compare(mark, ">=", "end"):
01508             return ""
01509         return self.text.get(mark, mark + " lineend+1c")

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1522 of file EditorWindow.py.

01522 
01523     def run(self):
01524         save_tabsize = _tokenize.tabsize
01525         _tokenize.tabsize = self.tabwidth
01526         try:
01527             try:
01528                 tokens = _tokenize.generate_tokens(self.readline)
01529                 for token in tokens:
01530                     self.tokeneater(*token)
01531             except _tokenize.TokenError:
01532                 # since we cut off the tokenizer early, we can trigger
01533                 # spurious errors
01534                 pass
01535         finally:
01536             _tokenize.tabsize = save_tabsize
01537         return self.blkopenline, self.indentedline

Here is the call graph for this function:

Here is the caller graph for this function:

def idlelib.EditorWindow.IndentSearcher.tokeneater (   self,
  type,
  token,
  start,
  end,
  line,
  INDENT = _tokenize.INDENT,
  NAME = _tokenize.NAME,
  OPENERS = ('class', 'def',
  for,
  if,
  try,
  while 
)

Definition at line 1513 of file EditorWindow.py.

01513 
01514                    OPENERS=('class', 'def', 'for', 'if', 'try', 'while')):
01515         if self.finished:
01516             pass
01517         elif type == NAME and token in OPENERS:
01518             self.blkopenline = line
01519         elif type == INDENT and self.blkopenline:
01520             self.indentedline = line
01521             self.finished = 1

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1499 of file EditorWindow.py.

Definition at line 1498 of file EditorWindow.py.

Definition at line 1498 of file EditorWindow.py.

Definition at line 1499 of file EditorWindow.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 1497 of file EditorWindow.py.

Definition at line 1496 of file EditorWindow.py.


The documentation for this class was generated from the following file: