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

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since c6fb57c was b3e8629, checked in by Piotr Rozyczko <rozyczko@…>, 7 years ago

Initial changes to make SasView? run with python3

  • Property mode set to 100755
File size: 548 bytes
RevLine 
[0215e0a]1import sys
2
3this = sys.modules[__name__]
4
5this._objects = {}
6
7def addObject(obj_name, obj):
8    this._objects[obj_name] = obj
9
[61a92d4]10def deleteObjectByRef(obj):
[b3e8629]11    for name, object in this._objects.items():
[61a92d4]12        if object == obj:
13            del this._objects[name]
14            break
15
16def deleteObjectByName(obj_name):
[0215e0a]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():
[b3e8629]24    return list(this._objects.keys())
[0215e0a]25
26
27
Note: See TracBrowser for help on using the repository browser.