[Idle-dev] CVS: idle configHandler.py,1.17,1.18 config-main.def,1.8,1.9

Stephen M. Gava elguavas@users.sourceforge.net
Mon, 04 Feb 2002 20:51:37 -0800


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

Modified Files:
	configHandler.py config-main.def 
Log Message:
further work on config system and config saving


Index: configHandler.py
===================================================================
RCS file: /cvsroot/idlefork/idle/configHandler.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** configHandler.py	2002/02/01 03:02:37	1.17
--- configHandler.py	2002/02/05 04:51:35	1.18
***************
*** 9,14 ****
  # configuration problem notification and resolution. 
  
! import os
! import sys
  from ConfigParser import ConfigParser, NoOptionError, NoSectionError
  
--- 9,13 ----
  # configuration problem notification and resolution. 
  
! import os, sys, string
  from ConfigParser import ConfigParser, NoOptionError, NoSectionError
  
***************
*** 45,49 ****
          Get an option list for given section
          """
!         if self.has_section:
              return self.options(section)
          else:  #return a default value
--- 44,48 ----
          Get an option list for given section
          """
!         if self.has_section(section):
              return self.options(section)
          else:  #return a default value
***************
*** 517,521 ****
              '<<replace>>': ['<Control-h>'],
              '<<goto-line>>': ['<Alt-g>'] }
-         
          if keySetName:
              for event in keyBindings.keys():
--- 516,519 ----
***************
*** 523,530 ****
                  if binding: #otherwise will keep default
                      keyBindings[event]=binding
-             
          return keyBindings
  
!     
      def LoadCfgFiles(self):
          """ 
--- 521,564 ----
                  if binding: #otherwise will keep default
                      keyBindings[event]=binding
          return keyBindings
  
!     def GetExtraHelpSourceList(self,configSet):
!         """
!         Returns a list of tuples containing the details of any additional
!         help sources configured in the requested configSet ('user' or 'default')
!         , or an empty list if there are none. Returned tuples are of the form
!         form (menu_item , path_to_help_file , option).
!         """    
!         helpSources=[]
!         if configSet=='user':
!             cfgParser=self.userCfg['main']
!         elif configSet=='default':   
!             cfgParser=self.defaultCfg['main']
!         else:
!             raise 'Invalid configSet specified'
!         options=cfgParser.GetOptionList('HelpFiles')
!         for option in options:
!             value=cfgParser.Get('HelpFiles',option,default=';')
!             if value.find(';')==-1: #malformed config entry with no ';'
!                 menuItem='' #make these empty
!                 helpPath='' #so value won't be added to list
!             else: #config entry contains ';' as expected
!                 value=string.split(value,';')
!                 menuItem=value[0].strip()
!                 helpPath=value[1].strip()
!             if menuItem and helpPath: #neither are empty strings
!                 helpSources.append( (menuItem,helpPath,option) )
!         return helpSources
! 
!     def GetAllExtraHelpSourcesList(self):
!         """
!         Returns a list of tuples containing the details of all additional help 
!         sources configured, or an empty list if there are none. Tuples are of
!         the format returned by GetExtraHelpSourceList.
!         """ 
!         allHelpSources=( self.GetExtraHelpSourceList('default')+ 
!                 self.GetExtraHelpSourceList('user') )
!         return allHelpSources   
!         
      def LoadCfgFiles(self):
          """ 

Index: config-main.def
===================================================================
RCS file: /cvsroot/idlefork/idle/config-main.def,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** config-main.def	2002/01/22 05:56:40	1.8
--- config-main.def	2002/02/05 04:51:35	1.9
***************
*** 29,50 ****
  [General]
  editor-on-startup= 1
! #run-in-separate-process= 1
! #help-browser= ""
  
- [HelpFiles]
- #idle="IDLE _Help",""
- #python="_Python Documentation",""
- #additional help sources
- 1=
- 2=
- 3=
- 4=
- 5=
- 6=
- 7=
- 8=
- 9=
- 10=
- 
  [EditorWindow]
  width= 80
--- 29,35 ----
  [General]
  editor-on-startup= 1
! user-help-browser= 0
! user-help-browser-command= 
  
  [EditorWindow]
  width= 80
***************
*** 67,80 ****
  name= IDLE Classic Windows
  
! [RecentFiles]
! 1=
! 2=
! 3=
! 4=
! 5=
! 6=
! 7=
! 8=
! 9=
! 10=
! 
--- 52,73 ----
  name= IDLE Classic Windows
  
! [HelpFiles]
! #additional help sources, must be viewable by an html browser
! #will be listed on the Help/Other Help menu
! #option names are the sequence number of the option
! #values take the form: menu item;/path/to/help/source
! #obviously you can't use a semi-colon in a menu item or path and the path will 
! #be platform specific because of path separators, drive specs etc. 
! #eg.:
! #1= My Extra Help Source;/usr/share/doc/foo/index.html
! #2= Another Help Source;/path/to/another.html
! 
! #[RecentFiles]
! #this section will only be present in the user config file idle-main.cfg
! #where it will record the most recently openned files in the form
! #IndexNum= /full/path/of/file  , for display on the File/Recent Files menu
! #it is present here for reference only
! #eg.:
! #1=/most/recently/openned/file
! #2=/next/most/recently/openned/file
! #etc.