diff options
Diffstat (limited to 'atoideweb/tools/registry.py')
-rw-r--r-- | atoideweb/tools/registry.py | 57 |
1 files changed, 1 insertions, 56 deletions
diff --git a/atoideweb/tools/registry.py b/atoideweb/tools/registry.py index 8947d4d..a57285e 100644 --- a/atoideweb/tools/registry.py +++ b/atoideweb/tools/registry.py @@ -3,62 +3,7 @@ import logging # get application logger -logger = logging.getLogger('atoidejouer') - -class PixRegistry(object): - - class __Singleton: - """Our singleton object. - """ - - def __init__(self): - """Create the new singleton with the application config. - - :param config: SafeConfigParser object for all the application - :see: `ConfigParser.SafeConfigParser` - """ - # ensure config - self.__dict = dict() - - def __key(self, path, width, height): - return '%s|%sx%s' % (path, width, height) - - def get_pix(self, path, width, height): - # get key - _k = self.__key(path, width, height) - # .. - if _k in self.__dict: - return self.__dict[_k] - else: - return None - - def set_pix(self, path, width, height, pixbuf): - # get key - _k = self.__key(path, width, height) - # clear previous - if _k in self.__dict: - _p = self.__dict[_k] - _p.destroy() - else: - pass - # ... - self.__dict[_k] = pixbuf - - # singleton instance - instance = None - - def __new__(c, force=False): - """Singleton new init. - """ - # if doesn't already initialized - if not PixRegistry.instance \ - or force is True: - # create a new instance - PixRegistry.instance = PixRegistry.__Singleton() - else: - pass - # return the manager object - return PixRegistry.instance +logger = logging.getLogger('atoideweb') class InfoRegistry(object): |