Author: bugman Date: Fri May 4 16:59:59 2012 New Revision: 15969 URL: http://svn.gna.org/viewcvs/relax?rev=15969&view=rev Log: Removed the Page_storage singleton object as the idea does not work. While the pages cannot be recycled, a fundamental problem is if a wizard with the page is run at the same time as the user function page. More than one copy of the page must exist at the same time! Modified: branches/uf_redesign/gui/uf_objects.py Modified: branches/uf_redesign/gui/uf_objects.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/uf_objects.py?rev=15969&r1=15968&r2=15969&view=diff ============================================================================== --- branches/uf_redesign/gui/uf_objects.py (original) +++ branches/uf_redesign/gui/uf_objects.py Fri May 4 16:59:59 2012 @@ -39,25 +39,6 @@ from gui.wizard import Wiz_page, Wiz_window -class Page_storage(dict): - """A singleton container for holding all the user function pages.""" - - # Class variable for storing the class instance (for the singleton). - _instance = None - - def __new__(self, *args, **kargs): - """Replacement method for implementing the singleton design pattern.""" - - # First instantiation. - if self._instance is None: - # Instantiate. - self._instance = dict.__new__(self, *args, **kargs) - - # Already instantiated, so return the instance. - return self._instance - - - class Uf_object(object): """The object for auto-generating the GUI user functions.""" @@ -71,17 +52,8 @@ # Create the wizard dialog. wizard = Wiz_window(parent=self._parent, size_x=self._size[0], size_y=self._size[1], title=self._title) - # Create the user function page, if needed. - if self._name not in self._uf_pages.keys(): - # Create the page. - page = Uf_page(self._name, parent=wizard) - - # Store the page for later reuse. - self._uf_pages[self._name] = page - - # Fetch a pre-created page. - else: - page = self._uf_pages[self._name] + # Create the page. + page = Uf_page(self._name, parent=wizard) # Add the page to the wizard. wizard.add_page(page, apply_button=self._apply_button) @@ -112,9 +84,6 @@ self._size = size self._apply_button = apply_button - # The user function page singleton object. - self._uf_pages = Page_storage() - class Uf_page(Wiz_page):