Esempio n. 1
0
 def make(self, *args, **kwargs):
     """
     Allocates the necessary containers using allocate() and uses
     build() to make an instance which will be returned. The
     initialize() method of the instance will be called with the
     arguments and the keyword arguments. If 'mode' is in the
     keyword arguments it will be passed to build().
     """
     mode = kwargs.pop('mode', get_mode.get_default_mode())
     rval = self.make_no_init(mode)
     if hasattr(rval, 'initialize'):
         rval.initialize(*args, **kwargs)
     return rval
Esempio n. 2
0
 def make(self, *args, **kwargs):
     """
     Allocates the necessary containers using allocate() and uses
     build() to make an instance which will be returned. The
     initialize() method of the instance will be called with the
     arguments and the keyword arguments. If 'mode' is in the
     keyword arguments it will be passed to build().
     """
     mode = kwargs.pop('mode', get_mode.get_default_mode())
     rval = self.make_no_init(mode)
     if hasattr(rval, 'initialize'):
         rval.initialize(*args, **kwargs)
     return rval
Esempio n. 3
0
 def make_no_init(self, mode=None):
     """
     Allocates the necessary containers using allocate() and uses
     build() with the provided mode to make an instance which will
     be returned.  The initialize() method of the instance will not
     be called.
     """
     if mode is None:
         mode = get_mode.get_default_mode()
     memo = {}
     self.allocate(memo)
     rval = self.build(mode, memo)
     return rval
Esempio n. 4
0
 def make_no_init(self, mode=None):
     """
     Allocates the necessary containers using allocate() and uses
     build() with the provided mode to make an instance which will
     be returned.  The initialize() method of the instance will not
     be called.
     """
     if mode is None:
         mode = get_mode.get_default_mode()
     memo = {}
     self.allocate(memo)
     rval = self.build(mode, memo)
     return rval