Project/Project.py

branch
5_0_x
changeset 647
087c2941bd02
parent 521
29a1a1771e5a
child 792
a13346916170
equal deleted inserted replaced
642:9f31d84cb2b1 647:087c2941bd02
2308 if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python3"]: 2308 if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python3"]:
2309 fn = os.path.join(self.ppath, "__init__.py") 2309 fn = os.path.join(self.ppath, "__init__.py")
2310 f = open(fn, "w", encoding = "utf-8") 2310 f = open(fn, "w", encoding = "utf-8")
2311 f.close() 2311 f.close()
2312 self.appendFile(fn, True) 2312 self.appendFile(fn, True)
2313 # create an empty main script file, if a name was given
2314 if len(self.pdata["MAINSCRIPT"]) and self.pdata["MAINSCRIPT"][0]:
2315 if not os.path.isabs(self.pdata["MAINSCRIPT"][0]):
2316 ms = os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0])
2317 else:
2318 ms = self.pdata["MAINSCRIPT"][0]
2319 f = open(ms, "w")
2320 f.close()
2321 self.appendFile(ms, True)
2313 tpd = os.path.join(self.ppath, self.translationsRoot) 2322 tpd = os.path.join(self.ppath, self.translationsRoot)
2314 if not self.translationsRoot.endswith(os.sep): 2323 if not self.translationsRoot.endswith(os.sep):
2315 tpd = os.path.dirname(tpd) 2324 tpd = os.path.dirname(tpd)
2316 if not os.path.isdir(tpd): 2325 if not os.path.isdir(tpd):
2317 os.makedirs(tpd) 2326 os.makedirs(tpd)
2332 if not os.path.exists(mgmtDir): 2341 if not os.path.exists(mgmtDir):
2333 os.makedirs(mgmtDir) 2342 os.makedirs(mgmtDir)
2334 2343
2335 try: 2344 try:
2336 ms = os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0]) 2345 ms = os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0])
2337 if os.path.exists(ms): 2346 if not os.path.exists(ms):
2338 self.appendFile(ms) 2347 f = open(ms, "w")
2348 f.close()
2349 self.appendFile(ms)
2339 except IndexError: 2350 except IndexError:
2340 ms = "" 2351 ms = ""
2341 2352
2342 # add existing files to the project 2353 # add existing files to the project
2343 res = QMessageBox.question(None, 2354 res = QMessageBox.question(None,

eric ide

mercurial