eric6/Project/Project.py

changeset 7830
72499e626226
parent 7785
9978016560ec
child 7836
2f0d208b8137
equal deleted inserted replaced
7829:5a99dd3ebe5f 7830:72499e626226
2360 if not os.path.isabs(self.pdata["MAINSCRIPT"]): 2360 if not os.path.isabs(self.pdata["MAINSCRIPT"]):
2361 ms = os.path.join( 2361 ms = os.path.join(
2362 self.ppath, self.pdata["MAINSCRIPT"]) 2362 self.ppath, self.pdata["MAINSCRIPT"])
2363 else: 2363 else:
2364 ms = self.pdata["MAINSCRIPT"] 2364 ms = self.pdata["MAINSCRIPT"]
2365 os.makedirs(os.path.dirname(ms))
2365 with open(ms, "w"): 2366 with open(ms, "w"):
2366 pass 2367 pass
2367 self.appendFile(ms, True) 2368 self.appendFile(ms, True)
2368 2369
2369 if self.pdata["MAKEPARAMS"]["MakeEnabled"]: 2370 if self.pdata["MAKEPARAMS"]["MakeEnabled"]:
2371 if mf: 2372 if mf:
2372 if not os.path.isabs(mf): 2373 if not os.path.isabs(mf):
2373 mf = os.path.join(self.ppath, mf) 2374 mf = os.path.join(self.ppath, mf)
2374 else: 2375 else:
2375 mf = os.path.join(self.ppath, Project.DefaultMakefile) 2376 mf = os.path.join(self.ppath, Project.DefaultMakefile)
2377 os.makedirs(os.path.dirname(mf))
2376 with open(mf, "w"): 2378 with open(mf, "w"):
2377 pass 2379 pass
2378 self.appendFile(mf) 2380 self.appendFile(mf)
2379 2381
2380 tpd = os.path.join(self.ppath, self.translationsRoot) 2382 tpd = os.path.join(self.ppath, self.translationsRoot)
2413 self.ppath, self.pdata["MAINSCRIPT"]) 2415 self.ppath, self.pdata["MAINSCRIPT"])
2414 else: 2416 else:
2415 ms = self.pdata["MAINSCRIPT"] 2417 ms = self.pdata["MAINSCRIPT"]
2416 if not os.path.exists(ms): 2418 if not os.path.exists(ms):
2417 try: 2419 try:
2420 os.makedirs(os.path.dirname(ms))
2418 with open(ms, "w"): 2421 with open(ms, "w"):
2419 pass 2422 pass
2420 except EnvironmentError as err: 2423 except EnvironmentError as err:
2421 E5MessageBox.critical( 2424 E5MessageBox.critical(
2422 self.ui, 2425 self.ui,
2436 mf = os.path.join(self.ppath, mf) 2439 mf = os.path.join(self.ppath, mf)
2437 else: 2440 else:
2438 mf = os.path.join(self.ppath, Project.DefaultMakefile) 2441 mf = os.path.join(self.ppath, Project.DefaultMakefile)
2439 if not os.path.exists(mf): 2442 if not os.path.exists(mf):
2440 try: 2443 try:
2444 os.makedirs(os.path.dirname(mf))
2441 with open(mf, "w"): 2445 with open(mf, "w"):
2442 pass 2446 pass
2443 except EnvironmentError as err: 2447 except EnvironmentError as err:
2444 E5MessageBox.critical( 2448 E5MessageBox.critical(
2445 self.ui, 2449 self.ui,

eric ide

mercurial