本文整理汇总了Python中machine.Machine.add方法的典型用法代码示例。如果您正苦于以下问题:Python Machine.add方法的具体用法?Python Machine.add怎么用?Python Machine.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类machine.Machine
的用法示例。
在下文中一共展示了Machine.add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import add [as 别名]
def run():
print 'machine echo side a'
ma = Machine('proxy_runner')
ma.add_peer(peer)
n = ProxyNode('node.example.TestNode')
ma.add(n)
return ma
示例2: run
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import add [as 别名]
def run():
print 'running simple machine'
m = Machine()
m.add_peer('PYRO:[email protected]:55090')
a = A()
m.add(a)
print 'perform a.one += 4'
a.one += 4
return m
示例3: run
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import add [as 别名]
def run():
ma = Machine('example')
m1 = Machine('foo')
m2 = Machine('bar')
n = TestNode()
n2 = OtherNode()
pr = Prox()
a = Address('example.TestNode')
pr.address = a
print '---add machines---'
ma.add(n, n2, pr)
ma.add_peer('PYRO:[email protected]:56894')
ma.add_peer('PYRO:[email protected]:41106')
return ma
示例4: run
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import add [as 别名]
def run():
print 'running direction direction'
m = Machine()
a= A()
nodes = [a, B()]
m.add(*nodes)
a.one += 1
print '> Step up one'
a.one += 1
print '> Step up three'
a.one += 3
print '> Step down two'
a.one -= 2
print '> Step is 4'
a.one = 100
return a
示例5: run
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import add [as 别名]
def run():
ma = Machine('example')
n = TestNode()
ma.add(n)
return ma
示例6: run
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import add [as 别名]
def run():
ma = Machine('example')
n = AlphaNode()
ma.add(n)
return ma