Did I find the right examples for you? yes no

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)

        def homify(path):
    """Replaces the homedirectory (if present) in the path with a tilde (~)."""
    homedir = QDir.homePath()
    if equal_paths(path[:len(homedir)+1], homedir + '/'):
        path = "~" + path[len(homedir):]
    return path
        


src/f/r/frescobaldi-HEAD/frescobaldi_app/externalchanges/widget.py   frescobaldi(Download)
        for dirname in sorted(dirs, key=util.naturalsort):
            diritem = QTreeWidgetItem()
            diritem.setText(0, util.homify(dirname))
            self.tree.addTopLevelItem(diritem)
            diritem.setExpanded(True)

src/f/r/frescobaldi-HEAD/frescobaldi_app/mainwindow.py   frescobaldi(Download)
                name.append(doc.documentName())
            elif doc.url().toLocalFile():
                name.append(util.homify(doc.url().toLocalFile()))
            else:
                name.append(doc.url().toString())
            f = url.toLocalFile()
            dirname, basename = os.path.split(f)
            text = "{0}  ({1})".format(basename, util.homify(dirname))
            self.menu_recent_files.addAction(text).url = url
        qutil.addAccelerators(self.menu_recent_files.actions())

src/f/r/frescobaldi-HEAD/frescobaldi_app/lilypondinfo.py   frescobaldi(Download)
            if sys.platform.startswith('darwin') and command.endswith('.app' + macstrip):
                command=command[:-len(macstrip)]
            return util.homify(command)
        else:
            return self.command

src/f/r/frescobaldi-HEAD/frescobaldi_app/contextmenu.py   frescobaldi(Download)
    def action(filename):
        url = QUrl.fromLocalFile(filename)
        a = QAction(menu)
        a.setText(_("Open \"{url}\"").format(url=util.homify(filename)))
        a.setIcon(icons.get('document-open'))
                else:
                    a.setText(_("&Jump to definition (in {filename})").format(
                        filename=util.homify(target.document.filename)))
                @a.triggered.connect
                def activate():

src/f/r/frescobaldi-HEAD/frescobaldi_app/macosx/globalmenu.py   frescobaldi(Download)
        f = url.toLocalFile()
        dirname, basename = os.path.split(f)
        text = "{0}  ({1})".format(basename, util.homify(dirname))
        m.addAction(text).url = url
    qutil.addAccelerators(m.actions())

src/f/r/frescobaldi-HEAD/frescobaldi_app/doclist/widget.py   frescobaldi(Download)
        return None
    elif url.toLocalFile():
        return util.homify(os.path.dirname(url.toLocalFile()))
    else:
        return url.resolved(QUrl('.')).toString(QUrl.RemoveUserInfo)

src/f/r/frescobaldi-HEAD/frescobaldi_app/tabbar.py   frescobaldi(Download)
            self.setTabText(index, doc.documentName().replace('&', '&&'))
            if doc.url().toLocalFile():
                tooltip = util.homify(doc.url().toLocalFile())
            elif not doc.url().isEmpty():
                tooltip = doc.url().toString(QUrl.RemoveUserInfo)