本文整理匯總了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