示例#1
0
文件: tileset.py 项目: KDE/kajongg
def locateTileset(which):
    """locate the file with a tileset"""
    path = KStandardDirs.locate("kmahjonggtileset", QString(which))
    if path is None:
        logException(TileException('cannot find kmahjonggtileset %s' %
                                   (which)))
    return QString(path)
示例#2
0
def loadUi(base):
    """load the ui file for class base, deriving the file name from the class name"""
    name = base.__class__.__name__.lower() + '.ui'
    if os.path.exists(name):
        directory = os.getcwd()
    else:
        directory = os.path.dirname(str(KStandardDirs.locate("appdata", name)))
    uic.loadUi(os.path.join(directory, name), base)
示例#3
0
def loadUi(base):
    """load the ui file for class base, deriving the file name from the class name"""
    name = base.__class__.__name__.lower() + '.ui'
    if os.path.exists(name):
        directory = os.getcwd()
    else:
        directory = os.path.dirname(str(KStandardDirs.locate("appdata", name)))
    uic.loadUi(os.path.join(directory, name), base)
示例#4
0
def locatebackground(which):
    """locate the file with a background"""
    return QString(KStandardDirs.locate("kmahjonggbackground", QString(which)))
示例#5
0
def locateTileset(which):
    """locate the file with a tileset"""
    return QString(KStandardDirs.locate("kmahjonggtileset",
                QString(which)))
示例#6
0
def locatebackground(which):
    """locate the file with a background"""
    return QString(KStandardDirs.locate("kmahjonggbackground",
                QString(which)))