[Idle-dev] CVS: idle configHandler.py,1.19,1.20 configDialog.py,1.34,1.35

Stephen M. Gava elguavas@users.sourceforge.net
Sun, 10 Feb 2002 18:51:20 -0800


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

Modified Files:
	configHandler.py configDialog.py 
Log Message:
base GetHighlight on GetThemeDict for better defaults


Index: configHandler.py
===================================================================
RCS file: /cvsroot/idlefork/idle/configHandler.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** configHandler.py	11 Feb 2002 02:20:53 -0000	1.19
--- configHandler.py	11 Feb 2002 02:51:18 -0000	1.20
***************
*** 239,257 ****
          e.g., a tag_config call), otherwise fg or bg colour only as specified. 
          """
!         #get some fallback defaults
!         defaultFg=self.GetOption('highlight', theme, 'normal' + "-foreground",
!             default='#000000')
!         defaultBg=self.GetOption('highlight', theme, 'normal' + "-background",
!             default='#ffffff')
!         #try for requested element colours
!         fore = self.GetOption('highlight', theme, element + "-foreground")
!         back = None
!         if element == 'cursor': #there is no config value for cursor bg
!             back = None
          else:    
!             back = self.GetOption('highlight', theme, element + "-background")
!         #fall back if required
!         if not fore: fore=defaultFg
!         if not back: back=defaultBg
          highlight={"foreground": fore,"background": back}
          if not fgBg: #return dict of both colours
--- 239,251 ----
          e.g., a tag_config call), otherwise fg or bg colour only as specified. 
          """
!         if self.defaultCfg['highlight'].has_section(theme):
!             themeDict=self.GetThemeDict('default',theme)
!         else:
!             themeDict=self.GetThemeDict('user',theme)
!         fore=themeDict[element+'-foreground']
!         if element=='cursor': #there is no config value for cursor bg
!             back=themeDict['normal-background']
          else:    
!             back=themeDict[element+'-background']
          highlight={"foreground": fore,"background": back}
          if not fgBg: #return dict of both colours
***************
*** 264,268 ****
              else:    
                  raise 'Invalid fgBg specified'
!             
      def GetThemeDict(self,type,themeName):
          """
--- 258,262 ----
              else:    
                  raise 'Invalid fgBg specified'
! 
      def GetThemeDict(self,type,themeName):
          """
***************
*** 312,317 ****
                  'console-background':'#ffffff' }
          for element in theme.keys():
-             print 'themeName:',themeName,'theme exists:',cfgParser.has_section(
-                     themeName)
              if not cfgParser.has_option(themeName,element):
                  #we are going to return a default, print warning
--- 306,309 ----
***************
*** 386,390 ****
                  if event == vEvent:
                      extName=extn
-                     print extName
          return extName
      
--- 378,381 ----

Index: configDialog.py
===================================================================
RCS file: /cvsroot/idlefork/idle/configDialog.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** configDialog.py	11 Feb 2002 02:28:19 -0000	1.34
--- configDialog.py	11 Feb 2002 02:51:18 -0000	1.35
***************
*** 519,523 ****
  
      def AddChangedItem(self,type,section,item,value):
-         print type,section,item,value
          value=str(value) #make sure we use a string
          if not self.changedItems[type].has_key(section):
--- 519,522 ----
***************
*** 680,684 ****
          themeElement=sampleElement+'-'+plane
          self.AddChangedItem('highlight',theme,themeElement,newColour)
-         print self.changedItems['highlight'][theme]
  
      def GetNewThemeName(self,message):
--- 679,682 ----