Project/Project.py

changeset 153
ef200d69dba0
parent 152
ee3a13a0ad59
child 155
375e3c884874
equal deleted inserted replaced
152:ee3a13a0ad59 153:ef200d69dba0
3154 if Utilities.isWindowsPlatform(): 3154 if Utilities.isWindowsPlatform():
3155 return os.path.join(self.ppath, "_eric5project") 3155 return os.path.join(self.ppath, "_eric5project")
3156 else: 3156 else:
3157 return os.path.join(self.ppath, ".eric5project") 3157 return os.path.join(self.ppath, ".eric5project")
3158 3158
3159 def getHash(self):
3160 """
3161 Public method to get the project hash.
3162
3163 @return project hash as a hex string (string)
3164 """
3165 return self.pdata["HASH"][0]
3166
3167 def getRelativePath(self, fn):
3168 """
3169 Public method to convert a file path to a project relative
3170 file path.
3171
3172 @param fn file or directory name to convert (string)
3173 @return project relative path or unchanged path, if fn doesn't
3174 belong to the project (string)
3175 """
3176 return fn.replace(self.ppath + os.sep, "")
3177
3178 def getRelativeUniversalPath(self, fn):
3179 """
3180 Public method to convert a file path to a project relative
3181 file path with universal separators.
3182
3183 @param fn file or directory name to convert (string)
3184 @return project relative path or unchanged path, if fn doesn't
3185 belong to the project (string)
3186 """
3187 return Utilities.fromNativeSeparators(fn.replace(self.ppath + os.sep, ""))
3188
3159 def isProjectFile(self, fn): 3189 def isProjectFile(self, fn):
3160 """ 3190 """
3161 Public method used to check, if the passed in filename belongs to the project. 3191 Public method used to check, if the passed in filename belongs to the project.
3162 3192
3163 @param fn filename to be checked (string) 3193 @param fn filename to be checked (string)

eric ide

mercurial