Utilities, MicrobitDevices: added MicroPython to the known Python Variants.

Fri, 30 Aug 2019 19:07:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 30 Aug 2019 19:07:18 +0200
changeset 7186
ccd55666e9d2
parent 7185
af8e89a7a51d
child 7187
11b0c7802a70

Utilities, MicrobitDevices: added MicroPython to the known Python Variants.

eric6/MicroPython/MicrobitDevices.py file | annotate | diff | comparison | revisions
eric6/Utilities/__init__.py file | annotate | diff | comparison | revisions
--- a/eric6/MicroPython/MicrobitDevices.py	Fri Aug 30 19:00:38 2019 +0200
+++ b/eric6/MicroPython/MicrobitDevices.py	Fri Aug 30 19:07:18 2019 +0200
@@ -232,7 +232,7 @@
         if not aw:
             return
         
-        if not (aw.isPy3File() or aw.isPy2File()):
+        if not (aw.isPyFile() or aw.isMicroPythonFile()):
             yes = E5MessageBox.yesNo(
                 self.microPython,
                 self.tr("Flash Script"),
@@ -272,7 +272,7 @@
         if not aw:
             return
         
-        if not (aw.isPy3File() or aw.isPy2File()):
+        if not (aw.isPyFile() or aw.isMicroPythonFile()):
             yes = E5MessageBox.yesNo(
                 self.microPython,
                 self.tr("Save Script as 'main.py'"),
--- a/eric6/Utilities/__init__.py	Fri Aug 30 19:00:38 2019 +0200
+++ b/eric6/Utilities/__init__.py	Fri Aug 30 19:07:18 2019 +0200
@@ -1605,7 +1605,12 @@
         already (Editor object)
     @return Python version if file is Python2 or Python3 (int)
     """
-    pyAssignment = {"Python": 2, "Python2": 2, "Python3": 3}
+    pyAssignment = {
+        "Python": 2,
+        "Python2": 2,
+        "Python3": 3,
+        "MicroPython": 3,
+    }
     
     if not editor:
         viewManager = e5App().getObject('ViewManager')

eric ide

mercurial