예제 #1
0
 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()
예제 #2
0
 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()
예제 #3
0
 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
예제 #4
0
파일: bind.py 프로젝트: agoose77/hivesystem
                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"))
예제 #5
0
 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
예제 #6
0
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()
예제 #7
0
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()
예제 #8
0
                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
예제 #9
0
 def place(self):
     libcontext.push(self._contextname)
     for componentname, componentclass in self.components.items():
         component = getattr(self, componentname)
         component.place()
     libcontext.pop()
예제 #10
0
 def place(self):
     libcontext.push(self._contextname)
     for componentname, componentclass in self.components.items():
         component = getattr(self, componentname)
         component.place()
     libcontext.pop()