scripts/install.py

changeset 7178
43e994af5ee0
parent 7141
a479c75c6643
child 7185
af8e89a7a51d
--- a/scripts/install.py	Thu Aug 29 18:59:54 2019 +0200
+++ b/scripts/install.py	Thu Aug 29 19:00:33 2019 +0200
@@ -974,6 +974,25 @@
                         except EnvironmentError:
                             print("Could not install '{0}' (no permission)."
                                   .format(apiName))
+                
+                # copy MicroPython API files to the same destination
+                for apiName in glob.glob(os.path.join(eric6SourceDir, "APIs",
+                                                      "MicroPython", "*.api")):
+                    try:
+                        shutilCopy(apiName, apidir)
+                    except EnvironmentError:
+                        print("Could not install '{0}' (no permission)."
+                              .format(apiName))
+                for apiName in glob.glob(os.path.join(eric6SourceDir, "APIs",
+                                                      "MicroPython", "*.bas")):
+                    if os.path.exists(os.path.join(
+                        apidir, os.path.basename(
+                            apiName.replace(".bas", ".api")))):
+                        try:
+                            shutilCopy(apiName, apidir)
+                        except EnvironmentError:
+                            print("Could not install '{0}' (no permission)."
+                                  .format(apiName))
     
     # Create menu entry for Linux systems
     if sys.platform.startswith("linux"):
@@ -1335,6 +1354,12 @@
                     glob.glob(os.path.join(eric6SourceDir, "APIs", "Python3",
                                            "*.api"))):
                     apis.append(os.path.basename(apiName))
+                
+                # treat MicroPython API files the same as Python API files
+                for apiName in sorted(
+                    glob.glob(os.path.join(eric6SourceDir, "APIs",
+                                           "MicroPython", "*.api"))):
+                    apis.append(os.path.basename(apiName))
     
     config = (
         """# -*- coding: utf-8 -*-\n"""

eric ide

mercurial