eric6/Preferences/__init__.py

changeset 7592
f79dc58bdf62
parent 7570
a7a5750aded4
child 7598
6bb50f2a1df2
diff -r 16730b2c480c -r f79dc58bdf62 eric6/Preferences/__init__.py
--- a/eric6/Preferences/__init__.py	Sat May 09 12:56:17 2020 +0200
+++ b/eric6/Preferences/__init__.py	Mon May 11 18:30:25 2020 +0200
@@ -1478,6 +1478,7 @@
                                         # QChart.ChartTheme otherwise
         "MpyCrossCompiler": "",         # path of the mpy-cross compiler
         "DfuUtilPath": "",              # path of the dfu-util flashing tool
+        "IgnoredUnknownDevices": "[]",  # empty list encoded as JSON
         # documentation URLs
         "MicroPythonDocuUrl":
             "https://docs.micropython.org/en/latest/",
@@ -3576,6 +3577,14 @@
         return toBool(prefClass.settings.value(
             "MicroPython/" + key,
             prefClass.microPythonDefaults[key]))
+    elif key in ["IgnoredUnknownDevices"]:
+        jsonStr = prefClass.settings.value(
+            "MicroPython/" + key,
+            prefClass.microPythonDefaults[key])
+        if jsonStr:
+            return json.loads(jsonStr)
+        else:
+            return None
     else:
         return prefClass.settings.value(
             "MicroPython/" + key,
@@ -3590,7 +3599,14 @@
     @param value the value to be set
     @param prefClass preferences class used as the storage area
     """
-    prefClass.settings.setValue("MicroPython/" + key, value)
+    if key in ["IgnoredUnknownDevices"]:
+        prefClass.settings.setValue(
+            "MicroPython/" + key,
+            json.dumps(value))
+    else:
+        prefClass.settings.setValue(
+            "MicroPython/" + key,
+            value)
 
 
 def getGeometry(key, prefClass=Prefs):

eric ide

mercurial