From c54f7a67052feb651e7bdf01807a38d2b57add33 Mon Sep 17 00:00:00 2001 From: Ryan Sawhill Aroha Date: Tue, 31 Jan 2017 13:19:44 -0500 Subject: [PATCH] hotfix work-around for #108 --- modules/cfg.py | 4 ++-- modules/user_interface.py | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/cfg.py b/modules/cfg.py index beb8922..a587da1 100644 --- a/modules/cfg.py +++ b/modules/cfg.py @@ -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 diff --git a/modules/user_interface.py b/modules/user_interface.py index 8b86269..6fd9893 100644 --- a/modules/user_interface.py +++ b/modules/user_interface.py @@ -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]))