def __init__(self, **info): ''' Constructor. Arguments: info (dict): The database info ''' self._info = Map(info) self._data = None
def __init__(self, locale_file): ''' Constructor. Arguments: locale_file: The localization file ''' if not isinstance(locale_file, File): raise UnsupportedLocaleError('Unsupported localization') self._locale = str(locale_file.parent) self._domain = locale_file.basename self._translations = Map(yaml.load(unicode(locale_file.read())))
def __init__(self, func): ''' Constructor. Creates a new CachedMethod decorator. Arguments: func (callable): The callable to memoize ''' from places.core.types import Map self._func = func self._cache = {} self._cache_stats = Map(hits=0, misses=0) self.__name__ = func.__name__ self.__doc__ = func.__doc__