Added extra check to help make yard names unique

But not guaranateed
This commit is contained in:
Samuel M Smith 2014-03-03 17:20:23 -07:00
parent 139f76685b
commit 25b449898a
3 changed files with 17 additions and 18 deletions

View File

@ -262,8 +262,7 @@ class StackUxdRaet(deeding.Deed): # pylint: disable=W0232
rxmsgs=odict(ipath='rxmsgs', ival=deque()),
local=odict(ipath='local', ival=odict(name='minion',
yardname="",
yid=0,
ane="maple")),)
lane="maple")),)
def postinitio(self):
'''
@ -271,7 +270,6 @@ class StackUxdRaet(deeding.Deed): # pylint: disable=W0232
'''
name = self.local.data.name
yardname = self.local.data.yardname
yid = self.local.data.yid
lane = self.local.data.lane
txMsgs = self.txmsgs.value
rxMsgs = self.rxmsgs.value
@ -279,7 +277,6 @@ class StackUxdRaet(deeding.Deed): # pylint: disable=W0232
self.stack.value = stacking.StackUxd(
store=self.store,
name=name,
yid=yid,
yardname=yardname,
lanename=lane,
txMsgs=txMsgs,
@ -314,15 +311,15 @@ class AddYardStackUxdRaet(deeding.Deed): # pylint: disable=W0232
inode=".raet.uxd.stack.",
stack='stack',
yard='yard',
local=odict(ipath='local', ival=odict(name='serf', yid=0, lane="maple")),)
local=odict(ipath='local', ival=odict(name=None, lane="maple")),)
def action(self, lane="lane", yid=None, **kwa):
def action(self, lane="lane", name=None, **kwa):
'''
Adds new yard to stack on lane with yid
'''
stack = self.stack.value
if stack and isinstance(stack, stacking.StackUxd):
yard = yarding.Yard(stack=stack, prefix=lane, yid=yid)
yard = yarding.Yard(stack=stack, prefix=lane, name=name)
stack.addRemoteYard(yard)
self.yard.value = yard

View File

@ -303,7 +303,7 @@ def testStackUxd():
#serf stack
#yard1 = yarding.Yard(name='serf', yid=1)
stack1 = stacking.StackUxd(yid=1)
stack1 = stacking.StackUxd()
stack0.addRemoteYard(stack1.yard)
stack1.addRemoteYard(stack0.yard)
@ -399,10 +399,12 @@ def testStackUxd():
estate = 'minion1'
#lord stack yard0
stack0 = stacking.StackUxd(name='lord', lanename='cherry', yid=0)
stack0 = stacking.StackUxd(name='lord', lanename='cherry')
#serf stack yard1
stack1 = stacking.StackUxd(name='serf', lanename='cherry', yid=1)
stack1 = stacking.StackUxd(name='serf', lanename='cherry')
print "Yid", yarding.Yard.Yid
print "\n********* Attempt Auto Accept ************"
#stack0.addRemoteYard(stack1.yard)

View File

@ -2,8 +2,8 @@
house master
init .raet.uxd.stack.local to name "lord" lane "ash" yid 0
init .raet.uxd.stack.dest to "yard1"
init .raet.uxd.stack.local to name "lord" lane "ash" yardname "lord"
init .raet.uxd.stack.dest to "serf"
framer bossuxdstack be active first start
frame start
@ -22,19 +22,19 @@ framer uxdreceiver be active first start
framer setupuxdyard be active first start
frame start
enter
do raet uxd stack yard add to lane "ash" yid 1
do raet uxd stack yard add to lane "ash" name "serf"
timeout 1
frame send
enter
do raet uxd stack transmit to stuff "Lord Hello" \
do raet uxd stack transmit to stuff "Lord says Hello" \
per inode ".raet.uxd.stack."
house serf
init .raet.uxd.stack.local to name "serf" lane "ash" yid 1
init .raet.uxd.stack.dest to "yard0"
init .raet.uxd.stack.local to name "serf" lane "ash" yardname "serf"
init .raet.uxd.stack.dest to "lord"
framer serfuxdstack be active first start
frame start
@ -54,12 +54,12 @@ framer uxdreceiver be active first start
framer setupuxdyard be active first start
frame start
enter
do raet uxd stack yard add to lane "ash" yid 0
do raet uxd stack yard add to lane "ash" name "lord"
timeout 1
frame send
enter
do raet uxd stack transmit to stuff "Serf Hello" \
do raet uxd stack transmit to stuff "Serf says Hello" \
per inode ".raet.uxd.stack."