3165 """ |
3165 """ |
3166 Public method to check, if a path starts with the project path. |
3166 Public method to check, if a path starts with the project path. |
3167 |
3167 |
3168 @param path path to be checked (string) |
3168 @param path path to be checked (string) |
3169 """ |
3169 """ |
3170 if self.ppathRe: |
3170 if self.ppath and path == self.ppath: |
|
3171 return True |
|
3172 elif self.ppathRe: |
3171 return self.ppathRe.match(path) is not None |
3173 return self.ppathRe.match(path) is not None |
3172 else: |
3174 else: |
3173 return False |
3175 return False |
3174 |
3176 |
3175 def getProjectFile(self): |
3177 def getProjectFile(self): |
3207 @param path file or directory name to convert (string) |
3209 @param path file or directory name to convert (string) |
3208 @return project relative path or unchanged path, if path doesn't |
3210 @return project relative path or unchanged path, if path doesn't |
3209 belong to the project (string) |
3211 belong to the project (string) |
3210 """ |
3212 """ |
3211 if self.startswithProjectPath(path): |
3213 if self.startswithProjectPath(path): |
3212 return self.ppathRe.sub("", path, 1) |
3214 if self.ppath and path == self.ppath: |
|
3215 return "" |
|
3216 else: |
|
3217 return self.ppathRe.sub("", path, 1) |
3213 else: |
3218 else: |
3214 return path |
3219 return path |
3215 |
3220 |
3216 def getRelativeUniversalPath(self, path): |
3221 def getRelativeUniversalPath(self, path): |
3217 """ |
3222 """ |