Small code optimization in CSS modifying

Remove a stupid double loop when adding the extra CSS to the existing
stylesheets.
This commit is contained in:
David 2016-06-01 21:49:34 +10:00
parent 9c97808328
commit 8e5dc1d23f

View File

@ -2016,7 +2016,7 @@ class KOBOTOUCH(KOBO):
# append all rules from kobo extra css # append all rules from kobo extra css
debug_print("KoboTouch:_modify_stylesheet: Append all kobo extra css rules") debug_print("KoboTouch:_modify_stylesheet: Append all kobo extra css rules")
for extra_rule in [r for r in self.extra_sheet.cssRules]: for extra_rule in self.extra_sheet.cssRules:
sheet.insertRule(extra_rule) sheet.insertRule(extra_rule)
is_dirty = True is_dirty = True
@ -2797,7 +2797,7 @@ class KOBOTOUCH(KOBO):
try: try:
return getattr(opts, key) return getattr(opts, key)
except: except:
debug_print("KoboTouch::get_prefs - probably an extra_customization") debug_print("KoboTouch::get_prefs - probably an extra_customization:", key)
return None return None
@classmethod @classmethod