[Python-checkins] python/dist/src/Lib/idlelib IdleHistory.py, 1.4, 1.5 NEWS.txt, 1.55, 1.56 config-main.def, 1.21, 1.22

kbk at users.sourceforge.net kbk at users.sourceforge.net
Thu Feb 3 02:37:17 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/idlelib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32060

Modified Files:
	IdleHistory.py NEWS.txt config-main.def 
Log Message:
Add config-main.def option to make the 'history' feature non-cyclic.
Default remains cyclic.  Python Patch 914546 Noam Raphael.

M IdleHistory.py
M NEWS.txt
M config-main.def



Index: IdleHistory.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/IdleHistory.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- IdleHistory.py	16 Sep 2002 22:09:19 -0000	1.4
+++ IdleHistory.py	3 Feb 2005 01:37:13 -0000	1.5
@@ -1,3 +1,5 @@
+from configHandler import idleConf
+
 class History:
 
     def __init__(self, text, output_sep = "\n"):
@@ -6,6 +8,7 @@
         self.history_prefix = None
         self.history_pointer = None
         self.output_sep = output_sep
+        self.cyclic = idleConf.GetOption("main", "History", "cyclic", 1, "bool")
         text.bind("<<history-previous>>", self.history_prev)
         text.bind("<<history-next>>", self.history_next)
 
@@ -40,7 +43,11 @@
             if reverse:
                 pointer = nhist
             else:
-                pointer = -1
+                if self.cyclic:
+                    pointer = -1
+                else:
+                    self.text.bell()
+                    return
         nprefix = len(prefix)
         while 1:
             if reverse:
@@ -49,10 +56,13 @@
                 pointer = pointer + 1
             if pointer < 0 or pointer >= nhist:
                 self.text.bell()
-                if self._get_source("iomark", "end-1c") != prefix:
-                    self.text.delete("iomark", "end-1c")
-                    self._put_source("iomark", prefix)
-                pointer = prefix = None
+                if not self.cyclic and pointer < 0:
+                    return
+                else:
+                    if self._get_source("iomark", "end-1c") != prefix:
+                        self.text.delete("iomark", "end-1c")
+                        self._put_source("iomark", prefix)
+                    pointer = prefix = None
                 break
             item = self.history[pointer]
             if item[:nprefix] == prefix and len(item) > nprefix:

Index: NEWS.txt
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- NEWS.txt	31 Jan 2005 03:34:26 -0000	1.55
+++ NEWS.txt	3 Feb 2005 01:37:13 -0000	1.56
@@ -3,6 +3,9 @@
 
 *Release date: XX-XXX-2005*
 
+- Add config-main option to make the 'history' feature non-cyclic.
+  Default remains cyclic.  Python Patch 914546 Noam Raphael.
+
 - Removed ability to configure tabs indent from Options dialog.  This 'feature'
   has never worked and no one has complained.  It is still possible to set a
   default tabs (v. spaces) indent 'manually' via config-main.def (or to turn on

Index: config-main.def
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/config-main.def,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- config-main.def	4 Jun 2004 06:31:08 -0000	1.21
+++ config-main.def	3 Feb 2005 01:37:14 -0000	1.22
@@ -18,8 +18,8 @@
 #     ~/.idlerc/config-highlight.cfg       the user highlighting config file
 #     ~/.idlerc/config-keys.cfg            the user keybinding config file
 #
-# On Windows2000 and Windows XP the .idlerc directory is at 
-#	Documents and Settings\<username>\.idlerc	
+# On Windows2000 and Windows XP the .idlerc directory is at
+#     Documents and Settings\<username>\.idlerc
 #
 # On Windows98 it is at c:\.idlerc
 #
@@ -73,4 +73,7 @@
 default= 1
 name= IDLE Classic Windows
 
+[History]
+cyclic=1
+
 [HelpFiles]



More information about the Python-checkins mailing list