Changeset fa412df in sasview for src/sas/sasgui/guiframe
- Timestamp:
- Sep 6, 2018 10:58:01 AM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
- Children:
- d0ce666f
- Parents:
- ec4b19c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/report_image_handler.py
r0cf4f84 rfa412df 3 3 4 4 class ReportImageHandler: 5 5 # Singleton class that manages all report plot images 6 # To call the handler, call the static method set_figs 6 7 7 8 class _ReportImageHandler: … … 14 15 15 16 def set_figs(self, figs, bitmaps, perspective): 17 """ 18 Save figures and images to memory and return refernces 19 :param figs: A list of matplotlib Figures 20 :param bitmaps: A list of bitmaps 21 :param perspective: A String with the perspective name 22 :return: A tuple of a list of Figures and a list of memory refs 23 """ 16 24 imgs = [] 17 25 refs = [] … … 34 42 35 43 def create_unique_name(self, perspective, index=None): 44 """ 45 Create a unique key for each item in memory 46 :param perspective: The perspective name as a string 47 :param index: The base index used for incrementing the name 48 :return: A unique file name not currently in use 49 """ 36 50 if not index: 37 51 index = len(self.indices) … … 43 57 return name 44 58 45 46 59 instance = None 47 60 48 def __init__(self): 61 @staticmethod 62 def set_figs(figs, bitmaps, perspective): 49 63 if not ReportImageHandler.instance: 50 64 ReportImageHandler.instance = ReportImageHandler._ReportImageHandler() 65 return ReportImageHandler.instance.set_figs(figs, bitmaps, perspective)
Note: See TracChangeset
for help on using the changeset viewer.