src/eric7/MicroPython/MicroPythonCommandsInterface.py

branch
eric7
changeset 9747
b7976868d5b0
parent 9653
e67609152c5e
child 9748
df9520c864f2
diff -r 37d460e32843 -r b7976868d5b0 src/eric7/MicroPython/MicroPythonCommandsInterface.py
--- a/src/eric7/MicroPython/MicroPythonCommandsInterface.py	Tue Feb 07 11:01:29 2023 +0100
+++ b/src/eric7/MicroPython/MicroPythonCommandsInterface.py	Tue Feb 07 18:07:12 2023 +0100
@@ -772,6 +772,16 @@
                     "    res['version'] = 'unknown'",
                 ]
             ),
+            "\n".join(
+                [
+                    "try:",
+                    "    import pimoroni",
+                    "    res['variant'] = 'Pimoroni'",
+                    "    del pimoroni",
+                    "except ImportError:",
+                    "    res['variant'] = ''",
+                ]
+            ),
             "print(res)",
             "del res, __sys_",
         ]
@@ -829,6 +839,16 @@
                     "    res['mpy_version'] = 'unknown'",
                 ]
             ),
+            "\n".join(
+                [
+                    "try:",
+                    "    import pimoroni",
+                    "    res['mpy_variant'] = 'Pimoroni'",
+                    "    del pimoroni",
+                    "except ImportError:",
+                    "    res['mpy_variant'] = ''",
+                ]
+            ),
             "stat_ = __os_.statvfs('/flash')",
             "res['flash_total_kb'] = stat_[2] * stat_[0] / 1024.0",
             "res['flash_free_kb'] = stat_[3] * stat_[0] / 1024.0",

eric ide

mercurial