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)
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)
def locatebackground(which): """locate the file with a background""" return QString(KStandardDirs.locate("kmahjonggbackground", QString(which)))
def locateTileset(which): """locate the file with a tileset""" return QString(KStandardDirs.locate("kmahjonggtileset", QString(which)))