Beispiel #1
0
 def short_path(self, name=True):
     path = self.file_path
     if not name:
         path = os.path.dirname(path)
     if self.project.path and path.startswith(self.project.path + os.path.sep):
         path = path[len(self.project.path) + 1:]
     return user_path(path)
Beispiel #2
0
 def pretty_path(self, document):
     """Get the path of this document relative to this app's temp dir"""
     path = document.file_path
     if path.startswith(self.tmp):
         return path[len(self.tmp):]
     return user_path(path)
Beispiel #3
0
 def windowTitleForDocumentDisplayName_(self, name):
     view = self.editor.current_view
     if view is not None and view.file_path is not None:
         return user_path(view.file_path)
     return name
Beispiel #4
0
 def tooltip_for_item(self, view, item):
     it = view.realItemForOpaqueItem_(item)
     null = it is None or it.file_path is None
     return None if null else user_path(it.file_path)
Beispiel #5
0
 def test(input, output):
     eq_(user_path(input), output)
Beispiel #6
0
def _default_project_path(editor=None):
    if editor is None or editor.project is None or editor.project.path is None:
        return None
    return user_path(editor.project.path)
Beispiel #7
0
 def test(input, output):
     eq_(user_path(input), output)