918 ) |
918 ) |
919 ) |
919 ) |
920 |
920 |
921 # install the API file |
921 # install the API file |
922 if installApis: |
922 if installApis: |
923 for progLanguage in progLanguages: |
923 if os.access(cfg["apidir"], os.W_OK): |
924 apidir = os.path.join(cfg["apidir"], progLanguage) |
924 for progLanguage in progLanguages: |
925 print("Installing {0} API files to '{1}'.".format(progLanguage, apidir)) |
925 apidir = os.path.join(cfg["apidir"], progLanguage) |
926 try: |
926 print("Installing {0} API files to '{1}'.".format(progLanguage, apidir)) |
927 if not os.path.exists(apidir): |
927 if not os.path.exists(apidir): |
928 os.makedirs(apidir) |
928 os.makedirs(apidir) |
929 except OSError: |
929 for apiName in glob.glob( |
930 print("Could not create '{0}' (no permission).".format(apidir)) |
930 os.path.join(eric7SourceDir, "APIs", progLanguage, "*.api") |
931 continue |
931 ): |
932 for apiName in glob.glob( |
|
933 os.path.join(eric7SourceDir, "APIs", progLanguage, "*.api") |
|
934 ): |
|
935 try: |
|
936 shutilCopy(apiName, apidir) |
932 shutilCopy(apiName, apidir) |
937 except OSError: |
933 for apiName in glob.glob( |
938 print("Could not install '{0}' (no permission).".format(apiName)) |
934 os.path.join(eric7SourceDir, "APIs", progLanguage, "*.bas") |
939 for apiName in glob.glob( |
935 ): |
940 os.path.join(eric7SourceDir, "APIs", progLanguage, "*.bas") |
|
941 ): |
|
942 try: |
|
943 shutilCopy(apiName, apidir) |
936 shutilCopy(apiName, apidir) |
944 except OSError: |
937 else: |
945 print("Could not install '{0}' (no permission).".format(apiName)) |
938 print("The API directory '{0}' is not writable.".format(cfg["apidir"])) |
|
939 print("Use the API files provided by the 'API Files' plug-in.") |
946 |
940 |
947 # Create menu entry for Linux systems |
941 # Create menu entry for Linux systems |
948 if sys.platform.startswith("linux"): |
942 if sys.platform.startswith("linux"): |
949 createLinuxSpecifics() |
943 createLinuxSpecifics() |
950 |
944 |