예제 #1
0
 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
예제 #2
0
 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