1717# the Free Software Foundation, Inc.,
1818# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919
20- import gi # pylint: disable=unused-import
21- from gi .repository import Gdk ,GLib ,Gtk # isort:skip
20+ from gi .repository import Gdk ,Gtk # isort:skip
2221
2322import logging
2423import os .path
@@ -82,10 +81,7 @@ def apply_css(self, css_fn):
8281if css_fn :
8382screen = Gdk .Screen .get_default ()
8483css_provider = Gtk .CssProvider ()
85- try :
86- css_provider .load_from_path (css_fn )
87- except GLib .Error as e :
88- logger .error (f"Error in theme:{ e } " )
84+ css_provider .load_from_path (css_fn )
8985context = Gtk .StyleContext ()
9086context .add_provider_for_screen (
9187screen ,css_provider ,Gtk .STYLE_PROVIDER_PRIORITY_USER
@@ -103,9 +99,9 @@ def load_colors(self, theme_fn):
10399 ]
104100regex = re .compile (r"@define-color\s(\w*)\s*(#\w{6}|@\w*)\s*;" )
105101if common .check_dark_theme ():
106- backup_color = "#ffffff"
102+ color_bak = "#ffffff"
107103else :
108- backup_color = "#000000"
104+ color_bak = "#000000"
109105with open (theme_fn ,"r" ,encoding = "UTF-8" )as reader :
110106lines = reader .readlines ()
111107for line in lines :
@@ -117,18 +113,18 @@ def load_colors(self, theme_fn):
117113logger .debug (f"loaded{ len (color_table )} colors from{ theme_fn } " )
118114for color in colors :
119115if color in color_table :
120- color_value = color_table [color ]
121- if color_value .startswith ("@" ):# lookup macro color
122- key = color_value [1 :]# dump the @
116+ color_val = color_table [color ]
117+ if color_val .startswith ("@" ):# lookup macro color
118+ key = color_val [1 :]# dump the @
123119if key in color_table :
124- color_value = color_table [key ]
120+ color_val = color_table [key ]
125121else :
126122logger .info (
127- f"Unknown Color alias :{ color_value } default to{ backup_color } "
123+ f"Unknown Color alias :{ color_val } default to{ color_bak } "
128124 )
129- color_value = backup_color
130- setattr (CONFIG .session ,color ,color_value )
131- logger .debug (f" --> updated color :{ color } to:{ color_value } " )
125+ color_val = color_bak
126+ setattr (CONFIG .session ,color ,color_val )
127+ logger .debug (f" --> updated color :{ color } to:{ color_val } " )
132128
133129def load_theme (self ):
134130theme_fn = os .path .join (const .THEME_DIR ,CONFIG .conf .theme )