Back to index

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

List of all members.

Public Member Functions

def __init__
def do
def redo
def undo
def __repr__
def merge
def save_marks
def set_marks

Public Attributes

 marks_before
 index1
 index2
 chars
 marks_after

Static Public Attributes

 tags = None

Detailed Description

Definition at line 264 of file UndoDelegator.py.


Constructor & Destructor Documentation

def idlelib.UndoDelegator.DeleteCommand.__init__ (   self,
  index1,
  index2 = None 
)

Definition at line 268 of file UndoDelegator.py.

00268 
00269     def __init__(self, index1, index2=None):
00270         Command.__init__(self, index1, index2, None, None)

Here is the caller graph for this function:


Member Function Documentation

def idlelib.UndoDelegator.Command.__repr__ (   self) [inherited]

Reimplemented in idlelib.UndoDelegator.CommandSequence.

Definition at line 175 of file UndoDelegator.py.

00175 
00176     def __repr__(self):
00177         s = self.__class__.__name__
00178         t = (self.index1, self.index2, self.chars, self.tags)
00179         if self.tags is None:
00180             t = t[:-1]
00181         return s + repr(t)

def idlelib.UndoDelegator.DeleteCommand.do (   self,
  text 
)

Reimplemented from idlelib.UndoDelegator.Command.

Definition at line 271 of file UndoDelegator.py.

00271 
00272     def do(self, text):
00273         self.marks_before = self.save_marks(text)
00274         self.index1 = text.index(self.index1)
00275         if self.index2:
00276             self.index2 = text.index(self.index2)
00277         else:
00278             self.index2 = text.index(self.index1 + " +1c")
00279         if text.compare(self.index2, ">", "end-1c"):
00280             # Don't delete the final newline
00281             self.index2 = text.index("end-1c")
00282         self.chars = text.get(self.index1, self.index2)
00283         text.delete(self.index1, self.index2)
00284         self.marks_after = self.save_marks(text)
00285         ##sys.__stderr__.write("do: %s\n" % self)

def idlelib.UndoDelegator.Command.merge (   self,
  cmd 
) [inherited]

Reimplemented in idlelib.UndoDelegator.InsertCommand.

Definition at line 191 of file UndoDelegator.py.

00191 
00192     def merge(self, cmd):
00193         return 0

def idlelib.UndoDelegator.DeleteCommand.redo (   self,
  text 
)

Reimplemented from idlelib.UndoDelegator.Command.

Definition at line 286 of file UndoDelegator.py.

00286 
00287     def redo(self, text):
00288         text.mark_set('insert', self.index1)
00289         text.delete(self.index1, self.index2)
00290         self.set_marks(text, self.marks_after)
00291         text.see('insert')
00292         ##sys.__stderr__.write("redo: %s\n" % self)

Here is the call graph for this function:

def idlelib.UndoDelegator.Command.save_marks (   self,
  text 
) [inherited]

Definition at line 194 of file UndoDelegator.py.

00194 
00195     def save_marks(self, text):
00196         marks = {}
00197         for name in text.mark_names():
00198             if name != "insert" and name != "current":
00199                 marks[name] = text.index(name)
00200         return marks

def idlelib.UndoDelegator.Command.set_marks (   self,
  text,
  marks 
) [inherited]

Definition at line 201 of file UndoDelegator.py.

00201 
00202     def set_marks(self, text, marks):
00203         for name, index in marks.items():
00204             text.mark_set(name, index)
00205 

Here is the caller graph for this function:

def idlelib.UndoDelegator.DeleteCommand.undo (   self,
  text 
)

Reimplemented from idlelib.UndoDelegator.Command.

Definition at line 293 of file UndoDelegator.py.

00293 
00294     def undo(self, text):
00295         text.mark_set('insert', self.index1)
00296         text.insert(self.index1, self.chars)
00297         self.set_marks(text, self.marks_before)
00298         text.see('insert')
00299         ##sys.__stderr__.write("undo: %s\n" % self)

Here is the call graph for this function:


Member Data Documentation

Reimplemented from idlelib.UndoDelegator.Command.

Definition at line 281 of file UndoDelegator.py.

Reimplemented from idlelib.UndoDelegator.Command.

Definition at line 273 of file UndoDelegator.py.

Reimplemented from idlelib.UndoDelegator.Command.

Definition at line 275 of file UndoDelegator.py.

Reimplemented from idlelib.UndoDelegator.Command.

Definition at line 283 of file UndoDelegator.py.

Reimplemented from idlelib.UndoDelegator.Command.

Definition at line 272 of file UndoDelegator.py.

idlelib.UndoDelegator.Command.tags = None [static, inherited]

Definition at line 164 of file UndoDelegator.py.


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