コード例 #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)
コード例 #2
0
ファイル: util.py プロジェクト: editxt/editxt
 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)
コード例 #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
コード例 #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)
コード例 #5
0
ファイル: test_util.py プロジェクト: editxt/editxt
 def test(input, output):
     eq_(user_path(input), output)
コード例 #6
0
ファイル: commands.py プロジェクト: editxt/editxt
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)
コード例 #7
0
ファイル: test_util.py プロジェクト: khairy/editxt
 def test(input, output):
     eq_(user_path(input), output)