def process_start(self): self.display = guild.lookup("display") self.surface = self.display.get_surface( self.size ) self.r, self.dr = 128, random.choice([-3,-2,-1,1,2,3]) self.g, self.dg = 128, random.choice([-3,-2,-1,1,2,3]) self.b, self.db = 128, random.choice([-3,-2,-1,1,2,3])
def process_start(self): tries = 0 while True: splitter = guild.lookup(self.name) if splitter is None: tries += 1 time.sleep(0.01) if tries > 100: raise Exception("BUST") else: break splitter.subscribe(self.input)
def PublishTo(name): splitter = guild.lookup(name) return splitter
#!/usr/bin/python from __future__ import print_function print("Guild Self Test") print(" ... test service registry") import guild guild.init() guild.register("hello", 5) x = guild.lookup("hello") assert x == 5 print("Self test successful")