[Idle-dev] CVS: idle IdleHistory.py,1.3,1.4

Kurt B. Kaiser kbk@users.sourceforge.net
Mon, 16 Sep 2002 15:09:21 -0700


Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv25379

Modified Files:
	IdleHistory.py 
Log Message:
Merge Py Idle changes:
Rev 1.5  doerwalter
string methods


Index: IdleHistory.py
===================================================================
RCS file: /cvsroot/idlefork/idle/IdleHistory.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** IdleHistory.py	13 Jul 2001 17:40:17 -0000	1.3
--- IdleHistory.py	16 Sep 2002 22:09:19 -0000	1.4
***************
*** 1,4 ****
- import string
- 
  class History:
  
--- 1,2 ----
***************
*** 23,31 ****
          # Get source code from start index to end index.  Lines in the
          # text control may be separated by sys.ps2 .
!         lines = string.split(self.text.get(start, end), self.output_sep)
!         return string.join(lines, "\n")
  
      def _put_source(self, where, source):
!         output = string.join(string.split(source, "\n"), self.output_sep)
          self.text.insert(where, output)
  
--- 21,29 ----
          # Get source code from start index to end index.  Lines in the
          # text control may be separated by sys.ps2 .
!         lines = self.text.get(start, end).split(self.output_sep)
!         return "\n".join(lines)
  
      def _put_source(self, where, source):
!         output = self.output_sep.join(source.split("\n"))
          self.text.insert(where, output)
  
***************
*** 69,73 ****
  
      def history_store(self, source):
!         source = string.strip(source)
          if len(source) > 2:
              # avoid duplicates
--- 67,71 ----
  
      def history_store(self, source):
!         source = source.strip()
          if len(source) > 2:
              # avoid duplicates
***************
*** 81,85 ****
  
      def recall(self, s):
!         s = string.strip(s)
          self.text.tag_remove("sel", "1.0", "end")
          self.text.delete("iomark", "end-1c")
--- 79,83 ----
  
      def recall(self, s):
!         s = s.strip()
          self.text.tag_remove("sel", "1.0", "end")
          self.text.delete("iomark", "end-1c")