install.py

branch
5_1_x
changeset 1344
54c50e65173f
parent 1189
946daca989b5
child 1347
c1f7967d062f
equal deleted inserted replaced
1340:142ad6decc3a 1344:54c50e65173f
333 # Cleanup API files 333 # Cleanup API files
334 try: 334 try:
335 apidir = getConfig('apidir') 335 apidir = getConfig('apidir')
336 for progLanguage in progLanguages: 336 for progLanguage in progLanguages:
337 for name in getConfig('apis'): 337 for name in getConfig('apis'):
338 apiname = os.path.join(apidir, progLanguage, name) 338 apiname = os.path.join(apidir, progLanguage.lower(), name)
339 if os.path.exists(apiname): 339 if os.path.exists(apiname):
340 os.remove(apiname) 340 os.remove(apiname)
341 for apiName in glob.glob(os.path.join(apidir, progLanguage.lower(), "*.bas")):
342 os.remove(apiname)
341 except AttributeError: 343 except AttributeError:
342 pass 344 pass
343 345
344 346
345 def installEric(): 347 def installEric():
470 for apiName in glob.glob(os.path.join(sourceDir, "APIs", progLanguage, "*.api")): 472 for apiName in glob.glob(os.path.join(sourceDir, "APIs", progLanguage, "*.api")):
471 try: 473 try:
472 shutil.copy(apiName, apidir) 474 shutil.copy(apiName, apidir)
473 except EnvironmentError: 475 except EnvironmentError:
474 print("Could not install '{0}'.".format(apiName)) 476 print("Could not install '{0}'.".format(apiName))
477 for apiName in glob.glob(os.path.join(sourceDir, "APIs", progLanguage, "*.bas")):
478 try:
479 shutil.copy(apiName, apidir)
480 except EnvironmentError:
481 print("Could not install '{0}'.".format(apiName))
475 if progLanguage == "Python": 482 if progLanguage == "Python":
476 # copy Python3 API files to the same destination 483 # copy Python3 API files to the same destination
477 for apiName in glob.glob(os.path.join(sourceDir, "APIs", "Python3", "*.api")): 484 for apiName in glob.glob(os.path.join(sourceDir, "APIs", "Python3", "*.api")):
485 try:
486 shutil.copy(apiName, apidir)
487 except EnvironmentError:
488 print("Could not install '{0}'.".format(apiName))
489 for apiName in glob.glob(os.path.join(sourceDir, "APIs", "Python3", "*.bas")):
478 try: 490 try:
479 shutil.copy(apiName, apidir) 491 shutil.copy(apiName, apidir)
480 except EnvironmentError: 492 except EnvironmentError:
481 print("Could not install '{0}'.".format(apiName)) 493 print("Could not install '{0}'.".format(apiName))
482 494

eric ide

mercurial