Rev | Line | |
---|
[0215e0a] | 1 | import sys |
---|
| 2 | |
---|
| 3 | this = sys.modules[__name__] |
---|
| 4 | |
---|
| 5 | this._objects = {} |
---|
| 6 | |
---|
| 7 | def addObject(obj_name, obj): |
---|
| 8 | this._objects[obj_name] = obj |
---|
| 9 | |
---|
[61a92d4] | 10 | def deleteObjectByRef(obj): |
---|
| 11 | for name, object in this._objects.iteritems(): |
---|
| 12 | if object == obj: |
---|
| 13 | del this._objects[name] |
---|
| 14 | break |
---|
| 15 | |
---|
| 16 | def deleteObjectByName(obj_name): |
---|
[0215e0a] | 17 | if obj_name in this._objects: |
---|
| 18 | del this._objects[obj_name] |
---|
| 19 | |
---|
| 20 | def getObject(obj_name): |
---|
| 21 | return this._objects[obj_name] if obj_name in this._objects else None |
---|
| 22 | |
---|
| 23 | def listObjects(): |
---|
| 24 | return this._objects.keys() |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | |
---|
Note: See
TracBrowser
for help on using the repository browser.