def getFactory(cls): activity = bs.getActivity() if activity is None: raise Exception("no current activity") try: return activity._sharedPowerupFactory except Exception: f = activity._sharedPowerupFactory = PowerupFactory() return f
def getFactory(cls): """ Returns a shared bs.PowerupFactory object, creating it if necessary. """ activity = bs.getActivity() if activity is None: raise Exception("no current activity") try: return activity._sharedPowerupFactory except Exception: f = activity._sharedPowerupFactory = PowerupFactory() return f