[Idle-dev] CVS: idle configHandler.py,1.15,1.16 config-keys.def,1.4,1.5

Stephen M. Gava elguavas@users.sourceforge.net
Thu, 31 Jan 2002 17:33:38 -0800


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

Modified Files:
	configHandler.py config-keys.def 
Log Message:
more work on configuration saving


Index: configHandler.py
===================================================================
RCS file: /cvsroot/idlefork/idle/configHandler.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** configHandler.py	2002/01/29 08:35:29	1.15
--- configHandler.py	2002/02/01 01:33:36	1.16
***************
*** 347,355 ****
          return names
          
      def GetExtensionKeys(self,extensionName):
          """
          returns a dictionary of the configurable keybindings for a particular
          extension,as they exist in the dictionary returned by GetCurrentKeySet;
!         that is, where previously re-used bindings are disabled.
          """
          keysName=extensionName+'_cfgBindings'
--- 347,371 ----
          return names
          
+     def GetExtnNameForEvent(self,virtualEvent):
+         """
+         Returns the name of the extension that virtualEvent is bound in, or
+         None if not bound in any extension.
+         virtualEvent - string, name of the virtual event to test for, without
+                        the enclosing '<< >>'
+         """
+         extName=None
+         vEvent='<<'+virtualEvent+'>>'
+         for extn in self.GetExtensions(activeOnly=0):
+             for event in self.GetExtensionKeys(extn).keys():
+                 if event == vEvent:
+                     extName=extn
+                     print extName
+         return extName
+     
      def GetExtensionKeys(self,extensionName):
          """
          returns a dictionary of the configurable keybindings for a particular
          extension,as they exist in the dictionary returned by GetCurrentKeySet;
!         that is, where previously used bindings are disabled.
          """
          keysName=extensionName+'_cfgBindings'
***************
*** 433,436 ****
--- 449,460 ----
          return keySet
  
+     def IsCoreBinding(self,virtualEvent):
+         """
+         returns true if the virtual event is bound in the core idle keybindings.
+         virtualEvent - string, name of the virtual event to test for, without
+                        the enclosing '<< >>'
+         """
+         return ('<<'+virtualEvent+'>>') in self.GetCoreKeys().keys()
+     
      def GetCoreKeys(self, keySetName=None):
          """
***************
*** 443,449 ****
          """
          keyBindings={
!             '<<Copy>>': ['<Control-c>', '<Control-C>'],
!             '<<Cut>>': ['<Control-x>', '<Control-X>'],
!             '<<Paste>>': ['<Control-v>', '<Control-V>'],
              '<<beginning-of-line>>': ['<Control-a>', '<Home>'],
              '<<center-insert>>': ['<Control-l>'],
--- 467,473 ----
          """
          keyBindings={
!             '<<copy>>': ['<Control-c>', '<Control-C>'],
!             '<<cut>>': ['<Control-x>', '<Control-X>'],
!             '<<paste>>': ['<Control-v>', '<Control-V>'],
              '<<beginning-of-line>>': ['<Control-a>', '<Home>'],
              '<<center-insert>>': ['<Control-l>'],

Index: config-keys.def
===================================================================
RCS file: /cvsroot/idlefork/idle/config-keys.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** config-keys.def	2002/01/19 00:29:54	1.4
--- config-keys.def	2002/02/01 01:33:36	1.5
***************
*** 7,13 ****
  
  [IDLE Classic Windows]
! Copy=<Control-c> <Control-C>
! Cut=<Control-x> <Control-X>
! Paste=<Control-v> <Control-V>
  beginning-of-line=<Control-a> <Home>
  center-insert=<Control-l>
--- 7,13 ----
  
  [IDLE Classic Windows]
! copy=<Control-c> <Control-C>
! cut=<Control-x> <Control-X>
! paste=<Control-v> <Control-V>
  beginning-of-line=<Control-a> <Home>
  center-insert=<Control-l>
***************
*** 41,47 ****
  
  [IDLE Classic Unix]
! Copy=<Alt-w> <Meta-w>
! Cut=<Control-w>
! Paste=<Control-y>
  beginning-of-line=<Control-a> <Home>
  center-insert=<Control-l>
--- 41,47 ----
  
  [IDLE Classic Unix]
! copy=<Alt-w> <Meta-w>
! cut=<Control-w>
! paste=<Control-y>
  beginning-of-line=<Control-a> <Home>
  center-insert=<Control-l>