@@ -164,7 +164,7 @@ def loadini(struct, configfile):
164164 key_dispatch [key ]
165165
166166# TODO consolidate
167- def load_gtk_theme (struct , path , inipath , default_colors ):
167+ def load_theme (struct , path , inipath , default_colors ):
168168 theme = ConfigParser ()
169169 try :
170170 f = open (path , 'r' )
@@ -173,7 +173,7 @@ def load_gtk_theme(struct, path, inipath, default_colors):
173173 (inipath , e ))
174174 sys .exit (1 )
175175 theme .readfp (f )
176- struct .color_gtk_scheme = {}
176+ struct .color_scheme = {}
177177 for k , v in chain (theme .items ('syntax' ), theme .items ('interface' )):
178178 if theme .has_option ('syntax' , k ):
179179 struct .color_scheme [k ] = theme .get ('syntax' , k )
@@ -187,6 +187,29 @@ def load_gtk_theme(struct, path, inipath, default_colors):
187187 f .close ()
188188
189189
190+ def load_gtk_theme (struct , path , inipath , default_colors ):
191+ theme = ConfigParser ()
192+ try :
193+ f = open (path , 'r' )
194+ except (IOError , OSError ), e :
195+ sys .stdout .write ("Error loading theme file specified in '%s':\n %s\n " %
196+ (inipath , e ))
197+ sys .exit (1 )
198+ theme .readfp (f )
199+ struct .color_gtk_scheme = {}
200+ for k , v in chain (theme .items ('syntax' ), theme .items ('interface' )):
201+ if theme .has_option ('syntax' , k ):
202+ struct .color_gtk_scheme [k ] = theme .get ('syntax' , k )
203+ else :
204+ struct .color_gtk_scheme [k ] = theme .get ('interface' , k )
205+
206+ # Check against default theme to see if all values are defined
207+ for k , v in default_colors .iteritems ():
208+ if k not in struct .color_gtk_scheme :
209+ struct .color_gtk_scheme [k ] = v
210+ f .close ()
211+
212+
190213
191214def migrate_rc (path ):
192215 """Use the shlex module to convert the old configuration file to the new
0 commit comments