from common import * class KP: @staticmethod def newMap(): from mapdata import KPMap KP.map = KPMap() @staticmethod def run(): KP.app = QtGui.QApplication(sys.argv) KP.newMap() from ui import KPMainWindow KP.mainWindow = KPMainWindow() KP.mainWindow.show() KP.app.exec_() @classmethod def icon(cls, name): try: cache = cls.iconCache except AttributeError: cache = {} cls.iconCache = cache try: return cache[name] except KeyError: icon = QtGui.QIcon('Resources/%s.png' % name) cache[name] = icon return icon