Skip to content

Commit

Permalink
Fixing pyblish#219
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Aug 11, 2015
1 parent 17f1ca0 commit de2e90b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyblish/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,15 @@ def __init__(self, *args, **kwargs):
self._children = dict()

def add(self, other):
super(Context, self).add(other)
if other in self:
raise ValueError("\"%s\" already in Context" % other)

self._children[other.id] = other
super(Context, self).add(other)

def remove(self, other):
super(Context, self).remove(other)
self._children.pop(other.id)
super(Context, self).remove(other)

def create_instance(self, name, **kwargs):
"""Convenience method of the following.
Expand Down

0 comments on commit de2e90b

Please sign in to comment.