Skip to content

Commit

Permalink
Merge pull request #110 from ryran/fix-bp-already-used-by-sibling
Browse files Browse the repository at this point in the history
hotfix work-around for #108
  • Loading branch information
ryran authored Jan 31, 2017
2 parents d5ca5cc + c54f7a6 commit 57073d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
prog = 'ravshello'

# Version info
__version__ = '1.12.1'
__date__ = '2017/01/26'
__version__ = '1.12.2'
__date__ = '2017/01/31'
version = "{} v{} last mod {}".format(prog, __version__, __date__)

# Defaults
Expand Down
14 changes: 12 additions & 2 deletions modules/user_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,9 +1330,19 @@ class Bp(ConfigNode):
Path: /blueprints/{BLUEPRINT_NAME}/
"""
def __init__(self, bpName, parent, bp):
ConfigNode.__init__(self, bpName, parent)
parent.numberOfBps += 1
try:
ConfigNode.__init__(self, bpName, parent)
except:
sibling = parent.get_child(bpName)
siblingBp = sibling.bp
newBpName = "zz___{}___id{}".format(bpName, sibling.bpId)
parent.remove_child(sibling)
Bp(newBpName, parent, siblingBp)
bpName = "zz___{}___id{}".format(bp['name'], bp['id'])
ConfigNode.__init__(self, bpName, parent)
self.bpName = bpName
parent.numberOfBps += 1
self.bp = bp
self.bpId = bp['id']
self.bpOwner = bp['owner']
self.creationTime = datetime.fromtimestamp(int(str(bp['creationTime'])[:-3]))
Expand Down

0 comments on commit 57073d3

Please sign in to comment.