Back to index

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

List of all members.

Public Member Functions

def __init__
def recolorize_main
def LoadTagDefs
def setdelegate
def config_colors
def insert
def delete
def notify_range
def close
def toggle_colorize_event
def recolorize
def removecolors
def __getattr__
def resetcache
def cachereport
def getdelegate

Public Attributes

 prog
 idprog
 asprog
 tagdefs
 stop_colorizing
 delegate

Static Public Attributes

 after_id = None
 allow_colorizing = True
 colorizing = False
 close_when_done = None

Detailed Description

Definition at line 280 of file PyShell.py.


Constructor & Destructor Documentation

Reimplemented from idlelib.ColorDelegator.ColorDelegator.

Definition at line 283 of file PyShell.py.

00283 
00284     def __init__(self):
00285         ColorDelegator.__init__(self)
00286         self.LoadTagDefs()

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def idlelib.Delegator.Delegator.__getattr__ (   self,
  name 
) [inherited]

Definition at line 9 of file Delegator.py.

00009 
00010     def __getattr__(self, name):
00011         attr = getattr(self.delegate, name) # May raise AttributeError
00012         setattr(self, name, attr)
00013         self.__cache[name] = attr
00014         return attr

Here is the call graph for this function:

def idlelib.Delegator.Delegator.cachereport (   self) [inherited]

Definition at line 23 of file Delegator.py.

00023 
00024     def cachereport(self):
00025         keys = list(self.__cache.keys())
00026         keys.sort()
00027         print(keys)

def idlelib.ColorDelegator.ColorDelegator.close (   self,
  close_when_done = None 
) [inherited]

Definition at line 105 of file ColorDelegator.py.

00105 
00106     def close(self, close_when_done=None):
00107         if self.after_id:
00108             after_id = self.after_id
00109             self.after_id = None
00110             if DEBUG: print("cancel scheduled recolorizer")
00111             self.after_cancel(after_id)
00112         self.allow_colorizing = False
00113         self.stop_colorizing = True
00114         if close_when_done:
00115             if not self.colorizing:
00116                 close_when_done.destroy()
00117             else:
00118                 self.close_when_done = close_when_done

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 53 of file ColorDelegator.py.

00053 
00054     def config_colors(self):
00055         for tag, cnf in self.tagdefs.items():
00056             if cnf:
00057                 self.tag_configure(tag, **cnf)
00058         self.tag_raise('sel')

Here is the call graph for this function:

Here is the caller graph for this function:

def idlelib.ColorDelegator.ColorDelegator.delete (   self,
  index1,
  index2 = None 
) [inherited]

Definition at line 82 of file ColorDelegator.py.

00082 
00083     def delete(self, index1, index2=None):
00084         index1 = self.index(index1)
00085         self.delegate.delete(index1, index2)
00086         self.notify_range(index1)

Here is the call graph for this function:

def idlelib.Delegator.Delegator.getdelegate (   self) [inherited]

Definition at line 32 of file Delegator.py.

00032 
00033     def getdelegate(self):
00034         return self.delegate
def idlelib.ColorDelegator.ColorDelegator.insert (   self,
  index,
  chars,
  tags = None 
) [inherited]

Definition at line 77 of file ColorDelegator.py.

00077 
00078     def insert(self, index, chars, tags=None):
00079         index = self.index(index)
00080         self.delegate.insert(index, chars, tags)
00081         self.notify_range(index, index + "+%dc" % len(chars))

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from idlelib.ColorDelegator.ColorDelegator.

Definition at line 292 of file PyShell.py.

00292 
00293     def LoadTagDefs(self):
00294         ColorDelegator.LoadTagDefs(self)
00295         theme = idleConf.GetOption('main','Theme','name')
00296         self.tagdefs.update({
00297             "stdin": {'background':None,'foreground':None},
00298             "stdout": idleConf.GetHighlight(theme, "stdout"),
00299             "stderr": idleConf.GetHighlight(theme, "stderr"),
00300             "console": idleConf.GetHighlight(theme, "console"),
00301         })

def idlelib.ColorDelegator.ColorDelegator.notify_range (   self,
  index1,
  index2 = None 
) [inherited]

Definition at line 91 of file ColorDelegator.py.

00091 
00092     def notify_range(self, index1, index2=None):
00093         self.tag_add("TODO", index1, index2)
00094         if self.after_id:
00095             if DEBUG: print("colorizing already scheduled")
00096             return
00097         if self.colorizing:
00098             self.stop_colorizing = True
00099             if DEBUG: print("stop colorizing")
00100         if self.allow_colorizing:
00101             if DEBUG: print("schedule colorizing")
00102             self.after_id = self.after(1, self.recolorize)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 136 of file ColorDelegator.py.

00136 
00137     def recolorize(self):
00138         self.after_id = None
00139         if not self.delegate:
00140             if DEBUG: print("no delegate")
00141             return
00142         if not self.allow_colorizing:
00143             if DEBUG: print("auto colorizing is off")
00144             return
00145         if self.colorizing:
00146             if DEBUG: print("already colorizing")
00147             return
00148         try:
00149             self.stop_colorizing = False
00150             self.colorizing = True
00151             if DEBUG: print("colorizing...")
00152             t0 = time.clock()
00153             self.recolorize_main()
00154             t1 = time.clock()
00155             if DEBUG: print("%.3f seconds" % (t1-t0))
00156         finally:
00157             self.colorizing = False
00158         if self.allow_colorizing and self.tag_nextrange("TODO", "1.0"):
00159             if DEBUG: print("reschedule colorizing")
00160             self.after_id = self.after(1, self.recolorize)
00161         if self.close_when_done:
00162             top = self.close_when_done
00163             self.close_when_done = None
00164             top.destroy()

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from idlelib.ColorDelegator.ColorDelegator.

Definition at line 287 of file PyShell.py.

00287 
00288     def recolorize_main(self):
00289         self.tag_remove("TODO", "1.0", "iomark")
00290         self.tag_add("SYNC", "1.0", "iomark")
00291         ColorDelegator.recolorize_main(self)

Here is the call graph for this function:

Definition at line 246 of file ColorDelegator.py.

00246 
00247     def removecolors(self):
00248         for tag in self.tagdefs:
00249             self.tag_remove(tag, "1.0", "end")

Here is the call graph for this function:

def idlelib.Delegator.Delegator.resetcache (   self) [inherited]

Definition at line 15 of file Delegator.py.

00015 
00016     def resetcache(self):
00017         for key in self.__cache:
00018             try:
00019                 delattr(self, key)
00020             except AttributeError:
00021                 pass
00022         self.__cache.clear()

Here is the caller graph for this function:

def idlelib.ColorDelegator.ColorDelegator.setdelegate (   self,
  delegate 
) [inherited]

Reimplemented from idlelib.Delegator.Delegator.

Definition at line 44 of file ColorDelegator.py.

00044 
00045     def setdelegate(self, delegate):
00046         if self.delegate is not None:
00047             self.unbind("<<toggle-auto-coloring>>")
00048         Delegator.setdelegate(self, delegate)
00049         if delegate is not None:
00050             self.config_colors()
00051             self.bind("<<toggle-auto-coloring>>", self.toggle_colorize_event)
00052             self.notify_range("1.0", "end")

Here is the call graph for this function:

def idlelib.ColorDelegator.ColorDelegator.toggle_colorize_event (   self,
  event 
) [inherited]

Definition at line 119 of file ColorDelegator.py.

00119 
00120     def toggle_colorize_event(self, event):
00121         if self.after_id:
00122             after_id = self.after_id
00123             self.after_id = None
00124             if DEBUG: print("cancel scheduled recolorizer")
00125             self.after_cancel(after_id)
00126         if self.allow_colorizing and self.colorizing:
00127             if DEBUG: print("stop colorizing")
00128             self.stop_colorizing = True
00129         self.allow_colorizing = not self.allow_colorizing
00130         if self.allow_colorizing and not self.colorizing:
00131             self.after_id = self.after(1, self.recolorize)
00132         if DEBUG:
00133             print("auto colorizing turned",\
00134                   self.allow_colorizing and "on" or "off")
00135         return "break"

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 87 of file ColorDelegator.py.

Definition at line 88 of file ColorDelegator.py.

Definition at line 41 of file ColorDelegator.py.

Definition at line 103 of file ColorDelegator.py.

Definition at line 89 of file ColorDelegator.py.

Definition at line 6 of file Delegator.py.

Definition at line 40 of file ColorDelegator.py.

Definition at line 39 of file ColorDelegator.py.

Definition at line 97 of file ColorDelegator.py.

Definition at line 61 of file ColorDelegator.py.


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