install.py

changeset 3948
6c3720179d6b
parent 3943
37d88bed7bb9
child 3950
6819272cafd5
equal deleted inserted replaced
3947:bee3a5d3f71c 3948:6c3720179d6b
623 cfg[key] = os.path.normpath(distDir + os.sep + cfg[key]) 623 cfg[key] = os.path.normpath(distDir + os.sep + cfg[key])
624 624
625 try: 625 try:
626 # Install the files 626 # Install the files
627 # make the install directories 627 # make the install directories
628 for key in list(cfg.keys()): 628 for key in cfg.keys():
629 if not os.path.isdir(cfg[key]): 629 if cfg[key] and not os.path.isdir(cfg[key]):
630 os.makedirs(cfg[key]) 630 os.makedirs(cfg[key])
631 631
632 # copy the eric6 config file 632 # copy the eric6 config file
633 if distDir: 633 if distDir:
634 shutilCopy(configName, cfg['mdir']) 634 shutilCopy(configName, cfg['mdir'])
909 909
910 def createInstallConfig(): 910 def createInstallConfig():
911 """ 911 """
912 Create the installation config dictionary. 912 Create the installation config dictionary.
913 """ 913 """
914 global modDir, platBinDir, cfg, apisDir 914 global modDir, platBinDir, cfg, apisDir, installApis
915 915
916 ericdir = os.path.join(modDir, "eric6") 916 ericdir = os.path.join(modDir, "eric6")
917 cfg = { 917 cfg = {
918 'ericDir': ericdir, 918 'ericDir': ericdir,
919 'ericPixDir': os.path.join(ericdir, "pixmaps"), 919 'ericPixDir': os.path.join(ericdir, "pixmaps"),
928 'ericCodeTemplatesDir': os.path.join(ericdir, 'CodeTemplates'), 928 'ericCodeTemplatesDir': os.path.join(ericdir, 'CodeTemplates'),
929 'ericOthersDir': ericdir, 929 'ericOthersDir': ericdir,
930 'bindir': platBinDir, 930 'bindir': platBinDir,
931 'mdir': modDir, 931 'mdir': modDir,
932 } 932 }
933 if apisDir: 933 if installApis:
934 cfg['apidir'] = apisDir 934 if apisDir:
935 else: 935 cfg['apidir'] = apisDir
936 cfg['apidir'] = os.path.join(ericdir, "api") 936 else:
937 cfg['apidir'] = os.path.join(ericdir, "api")
938 else:
939 cfg['apidir'] = ""
937 configLength = 15 940 configLength = 15
938 941
939 942
940 def createConfig(): 943 def createConfig():
941 """ 944 """
942 Create a config file with the respective config entries. 945 Create a config file with the respective config entries.
943 """ 946 """
944 global cfg, sourceDir, macAppBundlePath 947 global cfg, sourceDir, macAppBundlePath
945 948
946 apis = [] 949 apis = []
947 for progLanguage in progLanguages: 950 if installApis:
948 for apiName in glob.glob( 951 for progLanguage in progLanguages:
949 os.path.join(sourceDir, "APIs", progLanguage, "*.api")):
950 apis.append(os.path.basename(apiName))
951 if progLanguage == "Python":
952 # treat Python3 API files the same as Python API files
953 for apiName in glob.glob( 952 for apiName in glob.glob(
954 os.path.join(sourceDir, "APIs", "Python3", "*.api")): 953 os.path.join(sourceDir, "APIs", progLanguage, "*.api")):
955 apis.append(os.path.basename(apiName)) 954 apis.append(os.path.basename(apiName))
955 if progLanguage == "Python":
956 # treat Python3 API files the same as Python API files
957 for apiName in glob.glob(
958 os.path.join(sourceDir, "APIs", "Python3", "*.api")):
959 apis.append(os.path.basename(apiName))
956 960
957 fn = 'eric6config.py' 961 fn = 'eric6config.py'
958 config = ( 962 config = (
959 """# -*- coding: utf-8 -*-\n""" 963 """# -*- coding: utf-8 -*-\n"""
960 """#\n""" 964 """#\n"""

eric ide

mercurial