示例#1
0
            self.dr = random.choice([-3,-2,-1,1,2,3])
        if random.random() < 0.1:
            self.dg = random.choice([-3,-2,-1,1,2,3])
        if random.random() < 0.1:
            self.db = random.choice([-3,-2,-1,1,2,3])

        pygame.draw.rect(self.surface,
                         (self.r, self.g, self.b),
                          ( 0,0 , 
                           self.size[0], self.size[1]))
        self.display.blit(self.surface, self.location)

if __name__ == "__main__":
    display = Display()
    guild.init()
    guild.register("display", display)
    ticker = Ticker((300,200),(50,100))
    ticker2 = Ticker((300,200),(400,100))
    ticker3 = Ticker((300,200),(50,350))
    ticker4 = Ticker((300,200),(400,350))
    display.start()
    ticker.start()
    ticker2.start()
    ticker3.start()
    ticker4.start()
    time.sleep(60)

    ticker.stop()
    ticker2.stop()
    ticker3.stop()
    ticker4.stop()
示例#2
0
def Backplane(name):
    plane = Splitter()
    guild.register(name, plane)
    return plane
示例#3
0
def Backplane(name):
    plane = Splitter()
    guild.register(name, plane)
    return plane
示例#4
0
文件: __main__.py 项目: bbcrd/guild
#!/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")
示例#5
0
#!/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")