def place(self): libcontext.push(self._contextname) self.animationmanager.place() self.soundmanager.place() self.maincomponent.place() self.action1.place() self.action2.place() self.action3.place() libcontext.pop()
def __call__(self, w, contextname): if not hiveinstance(w, pinworker): raise TypeError("Cannot create new pinworker: first argument is not a pinworker") try: libcontext.push(self.contextname) ww = w.getinstance() ww.build(contextname) ww.parent = self.parent ww.place() ww.close() finally: libcontext.pop() return ww
def do_bind(self): if self.hive is None: raise ValueError( '"hive" is not defined in bind class "%s"' % name) bind_name = self.bindantennavalues["bindname"] class bindbridge(drone): def __init__(bridge): bridge.startup_functions = [] bridge.cleanup_functions = [] def place(bridge): self.on_place() # Expose these to the hive, per class s = libcontext.socketclasses.socket_supplier( bridge.startup_functions.append) libcontext.socket("startupfunction", s) s = libcontext.socketclasses.socket_supplier( bridge.cleanup_functions.append) libcontext.socket("cleanupfunction", s) class newhive(self.hive): zzz_bindbridgedrone = bindbridge() raiser = raiser() hiveconnect("evexc", raiser) hive = newhive().getinstance() try: libcontext.push(self._context.contextname) hive.build(bind_name) hive.place() finally: libcontext.pop() hive.close() hive.init() for function in newhive.zzz_bindbridgedrone.startup_functions: function() self.hives[bind_name] = hive # Raise start event if bind_name in self.event_handlers: handler = self.event_handlers[bind_name] handler(event("start"))
def __call__(self, w, contextname): if not hiveinstance(w, pinworker): raise TypeError( "Cannot create new pinworker: first argument is not a pinworker" ) try: libcontext.push(self.contextname) ww = w.getinstance() ww.build(contextname) ww.parent = self.parent ww.place() ww.close() finally: libcontext.pop() return ww
def declare_subtree(catch, spydertypetree, getter, attriblist): for mname, mtypetree in spydertypetree.members: mtypename = mtypetree.typename if hasattr(mtypetree, "arraycount"): for c in range(mtypetree.arraycount): mtypename += "Array" mtype = getattr(Spyder, mtypename) catchf = functools.partial(catch, mname) i = ("bee", "output", mname, mtypename) p = functools.partial(getter, attriblist + [mname]) pp = tryfunc(catchf, p) libcontext.plugin(i, plugin_supplier(pp)) if hasattr(mtypetree, "arraycount") and mtypetree.arraycount: continue nested = (hasattr(mtypetree, "members") and mtypetree.members is not None) if nested: c = libcontext.context(mname) libcontext.push(mname) declare_subtree(catch, mtypetree, getter, attriblist + [mname]) libcontext.pop()
def do_bind(self): class newhive(self.hive): zzz_bindbridgedrone = bindbridge(self) raiser = raiser() hiveconnect("evexc", raiser) hive = newhive().getinstance() try: libcontext.push(self._context.contextname) hive.build(self.b_bindname) hive.place() finally: libcontext.pop() hive.close() hive.init() for startup_function in self.startupfunctions: startup_function() self.hives[self.b_bindname] = hive
def place(self): libcontext.push(self._contextname) for componentname, componentclass in self.components.items(): component = getattr(self, componentname) component.place() libcontext.pop()