# HG changeset patch # User Jeff Hammel # Date 1355453524 28800 # Node ID 5f14a4183bf28dd33fd7120547b100c1dd4e4b8e # Parent 2fe3933f8eca4010d47e299d9380df9f58d6fc54 fix things diff -r 2fe3933f8eca -r 5f14a4183bf2 wsgraph/model.py --- a/wsgraph/model.py Thu Dec 13 18:11:52 2012 -0800 +++ b/wsgraph/model.py Thu Dec 13 18:52:04 2012 -0800 @@ -66,6 +66,13 @@ else: return self.edge(*key) + def __setitem__(self, key, value): + if isinstance(key, basestring) or (not isiterable(key)): + self.node(key, value) + else: + key1, key2 = key + self.edge(key1, key2, value) + def __contains__(self, key): """ if key is ..., returns if that node is in the graph