--- a/eric6/Preferences/__init__.py Tue Apr 13 17:49:05 2021 +0200 +++ b/eric6/Preferences/__init__.py Tue Apr 13 18:02:59 2021 +0200 @@ -2197,10 +2197,8 @@ @param value the colour to be set @param prefClass preferences class used as the storage area """ - if value.alpha() < 255: - val = "#{0:8x}".format(value.rgba()) - else: - val = value.name() + val = ("#{0:8x}".format(value.rgba()) if value.alpha() < 255 + else value.name()) prefClass.settings.setValue("Editor/Colour/" + key, val) @@ -2243,10 +2241,7 @@ @return requested list of API files @rtype list of str """ - if projectType: - key = "{0}_{1}".format(language, projectType) - else: - key = language + key = "{0}_{1}".format(language, projectType) if projectType else language apis = prefClass.settings.value("Editor/APIs/" + key) if apis is not None: if len(apis) and apis[0] == "": @@ -2274,10 +2269,7 @@ @param prefClass preferences class used as the storage area @type Prefs """ - if projectType: - key = "{0}_{1}".format(language, projectType) - else: - key = language + key = "{0}_{1}".format(language, projectType) if projectType else language prefClass.settings.setValue("Editor/APIs/" + key, apilist) @@ -3473,10 +3465,8 @@ @param value the colour to be set @param prefClass preferences class used as the storage area """ - if value.alpha() < 255: - val = "#{0:8x}".format(value.rgba()) - else: - val = value.name() + val = ("#{0:8x}".format(value.rgba()) + if value.alpha() < 255 else value.name()) prefClass.settings.setValue("Diff/" + key, val)