source: sasview/src/sas/qtgui/Utilities/ObjectLibrary.py @ c57ecca

Last change on this file since c57ecca was 61a92d4, checked in by Piotr Rozyczko <rozyczko@…>, 8 years ago

Minor UI resizing.
Refactored ObjectFactory?

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