def loadMod(modFile, target = None): '''Load mod into worldregistry or target; TODO: remove target loading from here''' global world target = target or world newMod = loader.modFromFile(modFile) if newMod: if target != world: newMod.applyMod(target) return None global lastMod lastMod += 1 mods[lastMod] = newMod newMod.applyMod(world) return lastMod else: return None
def loadMod(self, modFile): mod = loader.modFromFile(modFile) try: mod.applyMod(self) except AttributeError: logging.warning('client can\'t load mod')