def __init__(self, el, parent=None):
        super(MenuContentItem, self).__init__(parent)

        self.name = el.getAttribute('name')
        self.heading = None
        self.description1 = None
        self.description2 = None

        readme_dir = QFileInfo(__file__).dir()
        readme_dir.cdUp()
        readme_dir.cd(el.getAttribute('dirname'))

        self.readmePath = readme_dir.absoluteFilePath('README')

        self._prepared = False
예제 #2
0
    def __init__(self, el, parent=None):
        super(MenuContentItem, self).__init__(parent)

        self.name = el.getAttribute("name")
        self.heading = None
        self.description1 = None
        self.description2 = None

        readme_dir = QFileInfo(__file__).dir()
        readme_dir.cdUp()
        readme_dir.cd(el.getAttribute("dirname"))

        self.readmePath = readme_dir.absoluteFilePath("README")

        self._prepared = False
예제 #3
0
def get_embedded_dir(root, *subdirs):
    """ Return a QDir corresponding to an embedded directory.  root is the root
    directory and will be the __file__ attribute of a pyqtdeploy module.
    subdirs is a sequence of sub-directories from the root.  Return None if no
    such directory exists.
    """

    qdir = QFileInfo(root).absoluteDir()

    for subdir in subdirs:
        if not qdir.cd(subdir):
            return None

    return qdir
예제 #4
0
def get_embedded_dir(root, *subdirs):
    """ Return a QDir corresponding to an embedded directory.  root is the root
    directory and will be the __file__ attribute of a pyqtdeploy module.
    subdirs is a sequence of sub-directories from the root.  Return None if no
    such directory exists.
    """

    qdir = QFileInfo(root).absoluteDir()

    for subdir in subdirs:
        if not qdir.cd(subdir):
            return None

    return qdir
예제 #5
0
    def resolveDir(self, name):
        dirName = self.info[name]['dirname']
        fileName = self.info[name]['filename'].split('/')

        dir = QFileInfo(__file__).dir()
        # To the 'examples' directory.
        dir.cdUp()

        dir.cd(dirName)

        if len(fileName) > 1:
            dir.cd('/'.join(fileName[:-1]))

        # This may legitimately fail if the example is just a simple .py file.
        dir.cd(fileName[-1])

        return dir
예제 #6
0
    def resolveDir(self, name):
        dirName = self.info[name]['dirname']
        fileName = self.info[name]['filename'].split('/')

        dir = QFileInfo(__file__).dir()
        # To the 'examples' directory.
        dir.cdUp()

        dir.cd(dirName)

        if len(fileName) > 1:
            dir.cd('/'.join(fileName[:-1]))

        # This may legitimately fail if the example is just a simple .py file.
        dir.cd(fileName[-1])

        return dir
예제 #7
0
파일: util.py 프로젝트: yyolk/gpomodoro
def makeIcon(name, end="png"):
    iconPath = QFileInfo(__file__).dir()
    iconPath.cd("data")
    iconPath.cd("icons")
    iconPath = iconPath.filePath(f"{name}.{end}")
    return QIcon(iconPath)