592 cfg[key] = os.path.normpath(distDir + os.sep + cfg[key]) |
592 cfg[key] = os.path.normpath(distDir + os.sep + cfg[key]) |
593 |
593 |
594 try: |
594 try: |
595 # Install the files |
595 # Install the files |
596 # make the install directories |
596 # make the install directories |
597 for key in list(cfg.keys()): |
597 for key in cfg.keys(): |
598 if not os.path.isdir(cfg[key]): |
598 if cfg[key] and not os.path.isdir(cfg[key]): |
599 os.makedirs(cfg[key]) |
599 os.makedirs(cfg[key]) |
600 |
600 |
601 # copy the eric5 config file |
601 # copy the eric5 config file |
602 if distDir: |
602 if distDir: |
603 shutilCopy(configName, cfg['mdir']) |
603 shutilCopy(configName, cfg['mdir']) |
887 |
887 |
888 def createInstallConfig(): |
888 def createInstallConfig(): |
889 """ |
889 """ |
890 Create the installation config dictionary. |
890 Create the installation config dictionary. |
891 """ |
891 """ |
892 global modDir, platBinDir, cfg, apisDir |
892 global modDir, platBinDir, cfg, apisDir, installApis |
893 |
893 |
894 ericdir = os.path.join(modDir, "eric5") |
894 ericdir = os.path.join(modDir, "eric5") |
895 cfg = { |
895 cfg = { |
896 'ericDir': ericdir, |
896 'ericDir': ericdir, |
897 'ericPixDir': os.path.join(ericdir, "pixmaps"), |
897 'ericPixDir': os.path.join(ericdir, "pixmaps"), |
906 'ericCodeTemplatesDir': os.path.join(ericdir, 'CodeTemplates'), |
906 'ericCodeTemplatesDir': os.path.join(ericdir, 'CodeTemplates'), |
907 'ericOthersDir': ericdir, |
907 'ericOthersDir': ericdir, |
908 'bindir': platBinDir, |
908 'bindir': platBinDir, |
909 'mdir': modDir, |
909 'mdir': modDir, |
910 } |
910 } |
911 if apisDir: |
911 if installApis: |
912 cfg['apidir'] = apisDir |
912 if apisDir: |
|
913 cfg['apidir'] = apisDir |
|
914 else: |
|
915 cfg['apidir'] = os.path.join(ericdir, "api") |
913 else: |
916 else: |
914 cfg['apidir'] = os.path.join(ericdir, "api") |
917 cfg['apidir'] = "" |
915 configLength = 15 |
918 configLength = 15 |
916 |
919 |
917 |
920 |
918 def createConfig(): |
921 def createConfig(): |
919 """ |
922 """ |
920 Create a config file with the respective config entries. |
923 Create a config file with the respective config entries. |
921 """ |
924 """ |
922 global cfg, sourceDir, macAppBundlePath |
925 global cfg, sourceDir, macAppBundlePath |
923 |
926 |
924 apis = [] |
927 apis = [] |
925 for progLanguage in progLanguages: |
928 if installApis: |
926 for apiName in glob.glob( |
929 for progLanguage in progLanguages: |
927 os.path.join(sourceDir, "APIs", progLanguage, "*.api")): |
|
928 apis.append(os.path.basename(apiName)) |
|
929 if progLanguage == "Python": |
|
930 # treat Python3 API files the same as Python API files |
|
931 for apiName in glob.glob( |
930 for apiName in glob.glob( |
932 os.path.join(sourceDir, "APIs", "Python3", "*.api")): |
931 os.path.join(sourceDir, "APIs", progLanguage, "*.api")): |
933 apis.append(os.path.basename(apiName)) |
932 apis.append(os.path.basename(apiName)) |
|
933 if progLanguage == "Python": |
|
934 # treat Python3 API files the same as Python API files |
|
935 for apiName in glob.glob( |
|
936 os.path.join(sourceDir, "APIs", "Python3", "*.api")): |
|
937 apis.append(os.path.basename(apiName)) |
934 |
938 |
935 fn = 'eric5config.py' |
939 fn = 'eric5config.py' |
936 config = ( |
940 config = ( |
937 """# -*- coding: utf-8 -*-\n""" |
941 """# -*- coding: utf-8 -*-\n""" |
938 """#\n""" |
942 """#\n""" |