Project/ProjectFormsBrowser.py

changeset 5100
2c193da9b94f
parent 4631
5c1a96925da4
child 5331
8d607cd52f26
equal deleted inserted replaced
5099:175b36822cc9 5100:2c193da9b94f
745 """ 745 """
746 self.compileProc = QProcess() 746 self.compileProc = QProcess()
747 args = [] 747 args = []
748 self.buf = "" 748 self.buf = ""
749 749
750 if self.project.pdata["PROGLANGUAGE"][0] in \ 750 if self.project.getProjectLanguage() in \
751 ["Python", "Python2", "Python3"]: 751 ["Python", "Python2", "Python3"]:
752 if self.project.getProjectType() in ["Qt4", ]: 752 if self.project.getProjectType() in ["Qt4", ]:
753 self.uicompiler = 'pyuic4' 753 self.uicompiler = 'pyuic4'
754 if Utilities.isWindowsPlatform(): 754 if Utilities.isWindowsPlatform():
755 uic = self.uicompiler + '.bat' 755 uic = self.uicompiler + '.bat'
773 elif self.project.getProjectType() == "PySide": 773 elif self.project.getProjectType() == "PySide":
774 self.uicompiler = 'pyside-uic' 774 self.uicompiler = 'pyside-uic'
775 uic = Utilities.generatePySideToolPath(self.uicompiler) 775 uic = Utilities.generatePySideToolPath(self.uicompiler)
776 else: 776 else:
777 return None 777 return None
778 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": 778 elif self.project.getProjectLanguage() == "Ruby":
779 if self.project.getProjectType() == "Qt4": 779 if self.project.getProjectType() == "Qt4":
780 self.uicompiler = 'rbuic4' 780 self.uicompiler = 'rbuic4'
781 if Utilities.isWindowsPlatform(): 781 if Utilities.isWindowsPlatform():
782 uic = self.uicompiler + '.exe' 782 uic = self.uicompiler + '.exe'
783 else: 783 else:
788 return None 788 return None
789 789
790 ofn, ext = os.path.splitext(fn) 790 ofn, ext = os.path.splitext(fn)
791 fn = os.path.join(self.project.ppath, fn) 791 fn = os.path.join(self.project.ppath, fn)
792 792
793 if self.project.pdata["PROGLANGUAGE"][0] in \ 793 if self.project.getProjectLanguage() in \
794 ["Python", "Python2", "Python3"]: 794 ["Python", "Python2", "Python3"]:
795 dirname, filename = os.path.split(ofn) 795 dirname, filename = os.path.split(ofn)
796 self.compiledFile = os.path.join(dirname, "Ui_" + filename + ".py") 796 self.compiledFile = os.path.join(dirname, "Ui_" + filename + ".py")
797 args.append("-x") 797 args.append("-x")
798 indentWidth = Preferences.getQt("PyuicIndent") 798 indentWidth = Preferences.getQt("PyuicIndent")
799 if indentWidth != self.PyuicIndentDefault: 799 if indentWidth != self.PyuicIndentDefault:
800 args.append("--indent={0}".format(indentWidth)) 800 args.append("--indent={0}".format(indentWidth))
801 if Preferences.getQt("PyuicFromImports"): 801 if Preferences.getQt("PyuicFromImports"):
802 args.append("--from-imports") 802 args.append("--from-imports")
803 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": 803 elif self.project.getProjectLanguage() == "Ruby":
804 self.compiledFile = ofn + '.rb' 804 self.compiledFile = ofn + '.rb'
805 args.append('-x') 805 args.append('-x')
806 806
807 args.append(fn) 807 args.append(fn)
808 self.compileProc.finished.connect(self.__compileUIDone) 808 self.compileProc.finished.connect(self.__compileUIDone)
963 for fn in self.project.pdata["FORMS"]: 963 for fn in self.project.pdata["FORMS"]:
964 progress.setValue(i) 964 progress.setValue(i)
965 QApplication.processEvents() 965 QApplication.processEvents()
966 966
967 ifn = os.path.join(self.project.ppath, fn) 967 ifn = os.path.join(self.project.ppath, fn)
968 if self.project.pdata["PROGLANGUAGE"][0] in \ 968 if self.project.getProjectLanguage() in \
969 ["Python", "Python2", "Python3"]: 969 ["Python", "Python2", "Python3"]:
970 dirname, filename = os.path.split(os.path.splitext(ifn)[0]) 970 dirname, filename = os.path.split(os.path.splitext(ifn)[0])
971 ofn = os.path.join(dirname, "Ui_" + filename + ".py") 971 ofn = os.path.join(dirname, "Ui_" + filename + ".py")
972 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": 972 elif self.project.getProjectLanguage() == "Ruby":
973 ofn = os.path.splitext(ifn)[0] + '.rb' 973 ofn = os.path.splitext(ifn)[0] + '.rb'
974 if not os.path.exists(ofn) or \ 974 if not os.path.exists(ofn) or \
975 os.stat(ifn).st_mtime > os.stat(ofn).st_mtime: 975 os.stat(ifn).st_mtime > os.stat(ofn).st_mtime:
976 changedForms.append(fn) 976 changedForms.append(fn)
977 i += 1 977 i += 1

eric ide

mercurial