3837 |
3837 |
3838 @param path file or directory name to convert (string) |
3838 @param path file or directory name to convert (string) |
3839 @return project relative path or unchanged path, if path doesn't |
3839 @return project relative path or unchanged path, if path doesn't |
3840 belong to the project (string) |
3840 belong to the project (string) |
3841 """ |
3841 """ |
|
3842 if path is None: |
|
3843 return "" |
|
3844 |
3842 try: |
3845 try: |
3843 return str(pathlib.Path(path).relative_to(self.ppath)) |
3846 return str(pathlib.Path(path).relative_to(self.ppath)) |
3844 except ValueError: |
3847 except ValueError: |
3845 return path |
3848 return path |
3846 |
3849 |