Project/Project.py

changeset 2964
84b65fb9e780
parent 2888
e96fd56843d3
child 2995
63d874899b8b
equal deleted inserted replaced
2963:745d38097b7f 2964:84b65fb9e780
753 753
754 return res 754 return res
755 755
756 def __readUserProperties(self): 756 def __readUserProperties(self):
757 """ 757 """
758 Private method to read in the user specific project file (.e4q) 758 Private method to read in the user specific project file (.e4q).
759 """ 759 """
760 if self.pfile is None: 760 if self.pfile is None:
761 return 761 return
762 762
763 fn, ext = os.path.splitext(os.path.basename(self.pfile)) 763 fn, ext = os.path.splitext(os.path.basename(self.pfile))
811 self.sessActGrp.findChild(QAction, "project_load_session").setEnabled(enable) 811 self.sessActGrp.findChild(QAction, "project_load_session").setEnabled(enable)
812 self.sessActGrp.findChild(QAction, "project_delete_session").setEnabled(enable) 812 self.sessActGrp.findChild(QAction, "project_delete_session").setEnabled(enable)
813 813
814 def __readSession(self, quiet=False, indicator=""): 814 def __readSession(self, quiet=False, indicator=""):
815 """ 815 """
816 Private method to read in the project session file (.e4s) 816 Private method to read in the project session file (.e4s).
817 817
818 @param quiet flag indicating quiet operations. 818 @param quiet flag indicating quiet operations.
819 If this flag is true, no errors are reported. 819 If this flag is true, no errors are reported.
820 @keyparam indicator indicator string (string) 820 @keyparam indicator indicator string (string)
821 """ 821 """
896 self.trUtf8("<p>The project session file <b>{0}</b> could not be" 896 self.trUtf8("<p>The project session file <b>{0}</b> could not be"
897 " deleted.</p>").format(fn)) 897 " deleted.</p>").format(fn))
898 898
899 def __readTasks(self): 899 def __readTasks(self):
900 """ 900 """
901 Private method to read in the project tasks file (.e4t) 901 Private method to read in the project tasks file (.e4t).
902 """ 902 """
903 if self.pfile is None: 903 if self.pfile is None:
904 E5MessageBox.critical(self.ui, 904 E5MessageBox.critical(self.ui,
905 self.trUtf8("Read tasks"), 905 self.trUtf8("Read tasks"),
906 self.trUtf8("Please save the project first.")) 906 self.trUtf8("Please save the project first."))
962 self.dbgActGrp.findChild(QAction, "project_debugger_properties_delete")\ 962 self.dbgActGrp.findChild(QAction, "project_debugger_properties_delete")\
963 .setEnabled(enable) 963 .setEnabled(enable)
964 964
965 def __readDebugProperties(self, quiet=False): 965 def __readDebugProperties(self, quiet=False):
966 """ 966 """
967 Private method to read in the project debugger properties file (.e4d) 967 Private method to read in the project debugger properties file (.e4d).
968 968
969 @param quiet flag indicating quiet operations. 969 @param quiet flag indicating quiet operations.
970 If this flag is true, no errors are reported. 970 If this flag is true, no errors are reported.
971 """ 971 """
972 if self.pfile is None: 972 if self.pfile is None:
992 self.trUtf8("<p>The project debugger properties file <b>{0}</b> could" 992 self.trUtf8("<p>The project debugger properties file <b>{0}</b> could"
993 " not be read.</p>").format(fn)) 993 " not be read.</p>").format(fn))
994 994
995 def __writeDebugProperties(self, quiet=False): 995 def __writeDebugProperties(self, quiet=False):
996 """ 996 """
997 Private method to write the project debugger properties file (.e4d) 997 Private method to write the project debugger properties file (.e4d).
998 998
999 @param quiet flag indicating quiet operations. 999 @param quiet flag indicating quiet operations.
1000 If this flag is true, no errors are reported. 1000 If this flag is true, no errors are reported.
1001 """ 1001 """
1002 if self.pfile is None: 1002 if self.pfile is None:
1023 " not be written.</p>") 1023 " not be written.</p>")
1024 .format(fn)) 1024 .format(fn))
1025 1025
1026 def __deleteDebugProperties(self): 1026 def __deleteDebugProperties(self):
1027 """ 1027 """
1028 Private method to delete the project debugger properties file (.e4d) 1028 Private method to delete the project debugger properties file (.e4d).
1029 """ 1029 """
1030 if self.pfile is None: 1030 if self.pfile is None:
1031 E5MessageBox.critical(self.ui, 1031 E5MessageBox.critical(self.ui,
1032 self.trUtf8("Delete debugger properties"), 1032 self.trUtf8("Delete debugger properties"),
1033 self.trUtf8("Please save the project first.")) 1033 self.trUtf8("Please save the project first."))
1682 def getFiles(self, start): 1682 def getFiles(self, start):
1683 """ 1683 """
1684 Public method to get all files starting with a common prefix. 1684 Public method to get all files starting with a common prefix.
1685 1685
1686 @param start prefix (string) 1686 @param start prefix (string)
1687 @return list of files starting with a common prefix (list of strings)
1687 """ 1688 """
1688 filelist = [] 1689 filelist = []
1689 start = self.getRelativePath(start) 1690 start = self.getRelativePath(start)
1690 for key in ["SOURCES", "FORMS", "INTERFACES", "RESOURCES", "OTHERS"]: 1691 for key in ["SOURCES", "FORMS", "INTERFACES", "RESOURCES", "OTHERS"]:
1691 for entry in self.pdata[key][:]: 1692 for entry in self.pdata[key][:]:
2857 def startswithProjectPath(self, path): 2858 def startswithProjectPath(self, path):
2858 """ 2859 """
2859 Public method to check, if a path starts with the project path. 2860 Public method to check, if a path starts with the project path.
2860 2861
2861 @param path path to be checked (string) 2862 @param path path to be checked (string)
2863 @return flag indicating that the path starts with the project path
2864 (boolean)
2862 """ 2865 """
2863 if self.ppath: 2866 if self.ppath:
2864 if path == self.ppath: 2867 if path == self.ppath:
2865 return True 2868 return True
2866 elif Utilities.normcasepath(Utilities.toNativeSeparators(path)).startswith( 2869 elif Utilities.normcasepath(Utilities.toNativeSeparators(path)).startswith(

eric ide

mercurial