--- a/src/eric7/Preferences/__init__.py Wed Dec 20 11:06:38 2023 +0100 +++ b/src/eric7/Preferences/__init__.py Wed Dec 20 14:58:58 2023 +0100 @@ -1726,6 +1726,7 @@ Module function to read the tool groups configuration. @return list of tuples defing the tool groups + @rtype list of tuple """ toolGroups = [] groups = int(Prefs.settings.value("Toolgroups/Groups", 0)) @@ -1781,7 +1782,9 @@ Module function to write the tool groups configuration. @param toolGroups reference to the list of tool groups - @param currentGroup index of the currently selected tool group (integer) + @type list + @param currentGroup index of the currently selected tool group + @type int """ # first step, remove all tool group entries Prefs.settings.remove("Toolgroups") @@ -1908,7 +1911,8 @@ """ Module function to check, if the the application has been configured. - @return flag indicating the configured status (boolean) + @return flag indicating the configured status + @rtype bool """ return toBool(Prefs.settings.value("General/Configured", False)) @@ -1940,6 +1944,7 @@ Module function to retrieve the variables filter settings. @return a tuple defining the variables filter + @rtype tuple of (list, list) """ localsFilter = ast.literal_eval( Prefs.settings.value( @@ -1959,6 +1964,7 @@ Module function to store the variables filter settings. @param filters variable filters to set + @type list """ Prefs.settings.setValue("Variables/LocalsFilter", str(filters[0])) Prefs.settings.setValue("Variables/GlobalsFilter", str(filters[1])) @@ -2068,7 +2074,9 @@ Module function to retrieve the Python settings. @param key the key of the value to get + @type str @return the requested debugger setting + @rtype Any """ if key == "Python3Extensions": exts = [] @@ -2096,7 +2104,9 @@ Module function to store the Python settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key == "Python3Extensions": setDebugger(key, value) @@ -2117,6 +2127,7 @@ Module function to retrieve the language for the user interface. @return the language for the UI + @rtype str """ lang = Prefs.settings.value("UI/Language", Prefs.uiDefaults["Language"]) if lang in ("None", "", None): @@ -2130,6 +2141,7 @@ Module function to store the language for the user interface. @param lang the language + @type str """ if lang is None: Prefs.settings.setValue("UI/Language", "None") @@ -2142,6 +2154,7 @@ Module function to retrieve the selected viewmanager type. @return the viewmanager type + @rtype str """ return Prefs.settings.value("UI/ViewManager", Prefs.uiDefaults["ViewManager"]) @@ -2151,6 +2164,7 @@ Module function to store the selected viewmanager type. @param vm the viewmanager type + @type str """ Prefs.settings.setValue("UI/ViewManager", vm) @@ -2160,7 +2174,9 @@ Module function to retrieve the various UI settings. @param key the key of the value to get + @type str @return the requested UI setting + @rtype Any """ if key in [ "BrowsersListFoldersFirst", @@ -2285,7 +2301,9 @@ Module function to store the various UI settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key == "ViewProfiles": profiles = {} @@ -2322,7 +2340,9 @@ Module function to retrieve the various Icons settings. @param key the key of the value to get + @type str @return the requested Icons setting + @rtype Any """ if key in ["Path"]: return toList(Prefs.settings.value("UI/Icons/" + key, Prefs.iconsDefaults[key])) @@ -2335,7 +2355,9 @@ Module function to store the various Icons settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("UI/Icons/" + key, value) @@ -2345,7 +2367,9 @@ Module function to retrieve the various Cooperation settings. @param key the key of the value to get + @type str @return the requested UI setting + @rtype Any """ if key in ["AutoStartServer", "TryOtherPorts", "AutoAcceptConnections"]: return toBool( @@ -2370,7 +2394,9 @@ Module function to store the various Cooperation settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("Cooperation/" + key, value) @@ -2380,7 +2406,9 @@ Module function to retrieve the various editor settings. @param key the key of the value to get + @type str @return the requested editor setting + @rtype Any """ if key in [ "DefaultEncoding", @@ -2469,7 +2497,9 @@ Module function to store the various editor settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key == "TabIndentOverride": Prefs.settings.setValue("Editor/" + key, json.dumps(value)) @@ -2484,7 +2514,9 @@ Module function to retrieve the various editor marker colours. @param key the key of the value to get + @type str @return the requested editor colour + @rtype QColor """ col = Prefs.settings.value("Editor/Colour/" + key) if col is not None: @@ -2512,7 +2544,9 @@ Module function to store the various editor marker colours. @param key the key of the colour to be set + @type str @param value the colour to be set + @type QColor """ val = value.name(QColor.NameFormat.HexArgb) if value.alpha() < 255 else value.name() Prefs.settings.setValue("Editor/Colour/" + key, val) @@ -2524,7 +2558,9 @@ fonts. @param key the key of the value to get - @return the requested editor font (QFont) + @type str + @return the requested editor font + @rtype QFont """ f = QFont() f.fromString( @@ -2540,7 +2576,9 @@ Module function to store the various editor fonts except the lexer fonts. @param key the key of the font to be set - @param font the font to be set (QFont) + @type str + @param font the font to be set + @type QFont """ Prefs.settings.setValue("Editor/Other Fonts/" + key, font.toString()) @@ -2591,7 +2629,9 @@ Module function to retrieve the various lists of language keywords. @param key the key of the value to get - @return the requested list of language keywords (list of strings) + @type str + @return the requested list of language keywords + @rtype list of str """ keywords = Prefs.settings.value("Editor/Keywords/" + key) if keywords is not None: @@ -2605,7 +2645,9 @@ Module function to store the various lists of language keywords. @param key the key of the api to be set - @param keywordsLists the list of language keywords (list of strings) + @type str + @param keywordsLists the list of language keywords + @type list of str """ Prefs.settings.setValue("Editor/Keywords/" + key, keywordsLists) @@ -2615,7 +2657,7 @@ Module function to retrieve all lexer associations. @return a reference to the list of lexer associations - (dictionary of strings) + @rtype dict of str """ from eric7.QScintilla import Lexers @@ -2649,6 +2691,7 @@ Module function to retrieve all lexer associations. @param assocs dictionary of lexer associations to be set + @type dict """ # first remove lexer associations that no longer exist, than save the rest Prefs.settings.beginGroup("Editor/LexerAssociations") @@ -2666,8 +2709,9 @@ Module function to retrieve a lexer association. @param filename filename used to determine the associated lexer language - (string) - @return the requested lexer language (string) + @type str + @return the requested lexer language + @rtype str """ for pattern, language in getEditorLexerAssocs().items(): if fnmatch.fnmatch(filename, pattern): @@ -2681,7 +2725,9 @@ Module function to retrieve the various editor typing settings. @param key the key of the value to get + @type str @return the requested editor setting + @rtype Any """ return toBool( Prefs.settings.value("Editor/Typing/" + key, Prefs.editorTypingDefaults[key]) @@ -2693,7 +2739,9 @@ Module function to store the various editor typing settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("Editor/Typing/" + key, value) @@ -2703,7 +2751,9 @@ Module function to retrieve the various editor exporters settings. @param key the key of the value to get + @type str @return the requested editor setting + @rtype Any """ if key in ["RTF/Font"]: f = QFont() @@ -2755,7 +2805,9 @@ Module function to store the various editor exporters settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["RTF/Font"]: Prefs.settings.setValue("Editor/Exporters/" + key, value.toString()) @@ -2768,7 +2820,9 @@ Module function to retrieve the various printer settings. @param key the key of the value to get + @type str @return the requested printer setting + @rtype Any """ if key in ["ColorMode", "FirstPageFirst"]: return toBool( @@ -2791,7 +2845,9 @@ Module function to store the various printer settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["HeaderFont"]: Prefs.settings.setValue("Printer/" + key, value.toString()) @@ -2804,7 +2860,9 @@ Module function to retrieve the various shell settings. @param key the key of the value to get + @type str @return the requested shell setting + @rtype Any """ if key in ["MonospacedFont", "MarginsFont"]: f = QFont() @@ -2827,7 +2885,9 @@ Module function to store the various shell settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["MonospacedFont", "MarginsFont"]: Prefs.settings.setValue("Shell/" + key, value.toString()) @@ -2842,7 +2902,9 @@ Module function to retrieve the various project handling settings. @param key the key of the value to get + @type str @return the requested project setting + @rtype Any """ if key in ["RecentNumber"]: return int(Prefs.settings.value("Project/" + key, Prefs.projectDefaults[key])) @@ -2861,7 +2923,9 @@ Module function to store the various project handling settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["DebugClientsHistory", "DebuggerInterpreterHistory"]: # max. list sizes is hard coded to 20 entries @@ -2929,7 +2993,9 @@ Module function to retrieve the various project browser colours. @param key the key of the value to get + @type str @return the requested project browser colour + @rtype Any """ col = Prefs.settings.value("Project/Colour/" + key) if col is not None: @@ -2943,7 +3009,9 @@ Module function to store the various project browser colours. @param key the key of the colour to be set + @type str @param value the colour to be set + @type Any """ Prefs.settings.setValue("Project/Colour/" + key, value.name()) @@ -2953,7 +3021,9 @@ Module function to retrieve the various project handling settings. @param key the key of the value to get + @type str @return the requested project setting + @rtype Any """ if key in ["RecentNumber"]: return int( @@ -2974,7 +3044,9 @@ Module function to store the various project handling settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("MultiProject/" + key, value) @@ -3004,7 +3076,9 @@ Module function to retrieve the various help settings. @param key the key of the value to get + @type str @return the requested help setting + @rtype Any """ if key in ("HelpViewerType",): return int(Prefs.settings.value("Help/" + key, Prefs.helpDefaults[key])) @@ -3019,7 +3093,9 @@ Module function to store the various help settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("Help/" + key, value) @@ -3029,7 +3105,9 @@ Module function to retrieve the various web browser settings. @param key the key of the value to get + @type str @return the requested help setting + @rtype Any """ if not Prefs.webEngineSettingsIntitialized: Prefs.initWebEngineSettingsDefaults() @@ -3236,7 +3314,9 @@ Module function to store the various web browser settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["StandardFont", "FixedFont"]: Prefs.settings.setValue("WebBrowser/" + key, value.toString()) @@ -3297,7 +3377,9 @@ Module function to retrieve the various system settings. @param key the key of the value to get + @type str @return the requested system setting + @rtype Any """ from eric7.Utilities import supportedCodecs @@ -3315,7 +3397,9 @@ Module function to store the various system settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("System/" + key, value) @@ -3325,7 +3409,8 @@ Module function to retrieve the Qt6TranslationsDir setting depending on the current Qt version. - @return the requested setting (string) + @return the requested setting + @rtype str """ s = Prefs.settings.value( "Qt/Qt6TranslationsDir", Prefs.qtDefaults["Qt6TranslationsDir"] @@ -3344,7 +3429,9 @@ Module function to retrieve the various Qt settings. @param key the key of the value to get + @type str @return the requested Qt setting + @rtype Any """ if key in ["Qt6TranslationsDir"]: return getQtTranslationsDir() @@ -3367,7 +3454,9 @@ Module function to store the various Qt settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("Qt/" + key, value) @@ -3377,7 +3466,9 @@ Module function to retrieve the various user settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key == "MailServerPassword": return pwConvert( @@ -3414,7 +3505,9 @@ Module function to store the various user settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key == "MailServerPassword": Prefs.settings.setValue("User/" + key, pwConvert(value, encode=True)) @@ -3429,7 +3522,9 @@ Module function to retrieve the VCS related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key in ["StatusMonitorInterval", "CommitMessages"]: return int(Prefs.settings.value("VCS/" + key, Prefs.vcsDefaults[key])) @@ -3442,7 +3537,9 @@ Module function to store the VCS related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("VCS/" + key, value) @@ -3452,7 +3549,9 @@ Module function to retrieve the Tasks related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key in [ "TasksFixmeColor", @@ -3480,7 +3579,9 @@ Module function to store the Tasks related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in [ "TasksFixmeColor", @@ -3500,7 +3601,9 @@ Module function to retrieve the Templates related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key in ["SeparatorChar"]: return Prefs.settings.value("Templates/" + key, Prefs.templatesDefaults[key]) @@ -3521,7 +3624,9 @@ Module function to store the Templates related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["EditorFont"]: Prefs.settings.setValue("Templates/" + key, value.toString()) @@ -3534,7 +3639,9 @@ Module function to retrieve the plugin manager related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key in ["DownloadPath"]: return Prefs.settings.value( @@ -3565,7 +3672,9 @@ Module function to store the plugin manager related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("PluginManager/" + key, value) @@ -3575,7 +3684,9 @@ Module function to retrieve the Graphics related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key in ["Font"]: font = Prefs.settings.value("Graphics/" + key, Prefs.graphicsDefaults[key]) @@ -3595,7 +3706,9 @@ Module function to store the Graphics related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["Font"]: Prefs.settings.setValue("Graphics/" + key, value.toString()) @@ -3608,7 +3721,9 @@ Module function to retrieve the Icon Editor related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ return Prefs.settings.value("IconEditor/" + key, Prefs.iconEditorDefaults[key]) @@ -3618,7 +3733,9 @@ Module function to store the Icon Editor related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("IconEditor/" + key, value) @@ -3628,7 +3745,9 @@ Module function to retrieve the pyflakes related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key in ("IncludeInSyntaxCheck", "IgnoreStarImportWarnings"): return toBool( @@ -3647,7 +3766,9 @@ Module function to store the pyflakes related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("Py3Flakes/" + key, value) @@ -3657,7 +3778,9 @@ Module function to retrieve the tray starter related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ return Prefs.settings.value("TrayStarter/" + key, Prefs.trayStarterDefaults[key]) @@ -3667,7 +3790,9 @@ Module function to store the tray starter related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("TrayStarter/" + key, value) @@ -3677,7 +3802,9 @@ Module function to retrieve the IRC related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key in [ "TimestampIncludeDate", @@ -3703,7 +3830,9 @@ Module function to store the IRC related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("IRC/" + key, value) @@ -3713,7 +3842,9 @@ Module function to retrieve the Hex Editor related settings. @param key the key of the value to get + @type str @return the requested user setting + @rtype Any """ if key in ["AddressAreaWidth", "RecentNumber"]: return int( @@ -3744,7 +3875,9 @@ Module function to store the Hex Editor related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["Font"]: Prefs.settings.setValue("HexEditor/" + key, value.toString()) @@ -3757,7 +3890,9 @@ Module function to retrieve the colours for the diff highlighter. @param key the key of the value to get + @type str @return the requested diff colour + @rtype QColor """ col = Prefs.settings.value("Diff/" + key) if col is not None: @@ -3775,7 +3910,9 @@ Module function to store the diff highlighter colours. @param key the key of the colour to be set + @type str @param value the colour to be set + @type QColor """ val = "#{0:8x}".format(value.rgba()) if value.alpha() < 255 else value.name() Prefs.settings.setValue("Diff/" + key, val) @@ -3786,7 +3923,9 @@ Module function to retrieve the Code Documentation Viewer related settings. @param key the key of the value to get + @type str @return the requested Code Documentation Viewer value + @rtype Any """ if key in ["ShowInfoOnOpenParenthesis"]: return toBool( @@ -3805,7 +3944,9 @@ Module function to store the Code Documentation Viewer related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("CodeDocumentationViewer/" + key, value) @@ -3815,7 +3956,9 @@ Module function to retrieve the conda related settings. @param key the key of the value to get + @type str @return the requested conda value + @rtype Any """ return Prefs.settings.value("Conda/" + key, Prefs.condaDefaults[key]) @@ -3825,7 +3968,9 @@ Module function to store the conda related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("Conda/" + key, value) @@ -3835,7 +3980,9 @@ Module function to retrieve the pip related settings. @param key the key of the value to get + @type str @return the requested pip value + @rtype Any """ if key in ("ExcludeCondaEnvironments", "VulnerabilityCheckEnabled"): return toBool(Prefs.settings.value("Pip/" + key, Prefs.pipDefaults[key])) @@ -3850,7 +3997,9 @@ Module function to store the pip related settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ Prefs.settings.setValue("Pip/" + key, value) @@ -3860,7 +4009,9 @@ Module function to retrieve the MicroPython related settings. @param key the key of the value to get + @type str @return the requested MicroPython value + @rtype Any """ if key in ( "SerialTimeout", @@ -3908,7 +4059,9 @@ Module function to store the MicroPython settings. @param key the key of the setting to be set + @type str @param value the value to be set + @type Any """ if key in ["IgnoredUnknownDevices", "ManualDevices", "WebreplUrls"]: Prefs.settings.setValue("MicroPython/" + key, json.dumps(value)) @@ -4004,7 +4157,9 @@ Module function to retrieve the display geometry. @param key the key of the value to get + @type str @return the requested geometry setting + @rtype Any """ if key in ["MainMaximized"]: return toBool( @@ -4023,7 +4178,9 @@ Module function to store the display geometry. @param key the key of the setting to be set + @type str @param value the geometry to be set + @type Any """ if key in ["MainMaximized"]: Prefs.settings.setValue("Geometry/" + key, value) @@ -4046,7 +4203,8 @@ """ Module function to indicate a reset of the layout. - @return flag indicating a reset of the layout (boolean) + @return flag indicating a reset of the layout + @rtype bool """ return Prefs.resetLayout @@ -4065,7 +4223,9 @@ Module function to convert a value to bool. @param value value to be converted + @type Any @return converted data + @rtype bool """ if value in ["true", "1", "True"]: return True @@ -4080,7 +4240,9 @@ Module function to convert a value to a list. @param value value to be converted + @type list, None or Any @return converted data + @rtype list """ if value is None: return [] @@ -4095,7 +4257,9 @@ Module function to convert a value to a byte array. @param value value to be converted + @type QByteArray or None @return converted data + @rtype QByteArray """ if value is None: return QByteArray() @@ -4108,7 +4272,9 @@ Module function to convert a value to a dictionary. @param value value to be converted + @type dict or None @return converted data + @rtype dict """ if value is None: return {}