Project/CreateDialogCodeDialog.py

changeset 2737
dbe5497851fa
parent 2492
91ab554e3465
child 2741
d0d7836d0c01
equal deleted inserted replaced
2736:86cd4d14b58e 2737:dbe5497851fa
342 try: 342 try:
343 if self.project.getProjectLanguage() == "Python2": 343 if self.project.getProjectLanguage() == "Python2":
344 if self.project.getProjectType() == "PySide": 344 if self.project.getProjectType() == "PySide":
345 tmplName = os.path.join(getConfig('ericCodeTemplatesDir'), 345 tmplName = os.path.join(getConfig('ericCodeTemplatesDir'),
346 "impl_pyside.py2.tmpl") 346 "impl_pyside.py2.tmpl")
347 # TODO: add PyQt5
347 else: 348 else:
348 tmplName = os.path.join(getConfig('ericCodeTemplatesDir'), 349 tmplName = os.path.join(getConfig('ericCodeTemplatesDir'),
349 "impl_pyqt.py2.tmpl") 350 "impl_pyqt.py2.tmpl")
350 else: 351 else:
351 if self.project.getProjectType() == "PySide": 352 if self.project.getProjectType() == "PySide":
352 tmplName = os.path.join(getConfig('ericCodeTemplatesDir'), 353 tmplName = os.path.join(getConfig('ericCodeTemplatesDir'),
353 "impl_pyside.py.tmpl") 354 "impl_pyside.py.tmpl")
355 # TODO: add PyQt5
354 else: 356 else:
355 tmplName = os.path.join(getConfig('ericCodeTemplatesDir'), 357 tmplName = os.path.join(getConfig('ericCodeTemplatesDir'),
356 "impl_pyqt.py.tmpl") 358 "impl_pyqt.py.tmpl")
357 tmplFile = open(tmplName, 'r', encoding="utf-8") 359 tmplFile = open(tmplName, 'r', encoding="utf-8")
358 template = tmplFile.read() 360 template = tmplFile.read()
418 420
419 # do the coding stuff 421 # do the coding stuff
420 if self.project.getProjectLanguage() == "Python2": 422 if self.project.getProjectLanguage() == "Python2":
421 if self.project.getProjectType() == "PySide": 423 if self.project.getProjectType() == "PySide":
422 pyqtSignatureFormat = '@Slot({0})' 424 pyqtSignatureFormat = '@Slot({0})'
425 # TODO: add PyQt5 (pyqtSlot)
423 else: 426 else:
424 pyqtSignatureFormat = '@pyqtSignature("{0}")' 427 pyqtSignatureFormat = '@pyqtSignature("{0}")'
425 else: 428 else:
426 if self.project.getProjectType() == "PySide": 429 if self.project.getProjectType() == "PySide":
427 pyqtSignatureFormat = '@Slot({0})' 430 pyqtSignatureFormat = '@Slot({0})'

eric ide

mercurial