Coverage for python/lsst/daf/persistence/readProxy.py : 69%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#!/usr/bin/env python
# # LSST Data Management System # Copyright 2008, 2009, 2010 LSST Corporation. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <http://www.lsstcorp.org/LegalNotices/>. #
# -*- python -*-
"""ReadProxy provides a lazy-loading object that is initialized by a callback function set in ReadProxy's constructor. Adapted from peak.util.proxies.LazyProxy, which was written by Phillip J. Eby (peak@eby-sarna.com)."""
set_callback(self, func)
getattr(self.__subject__, attr)
setattr(self.__subject__, attr, val)
delattr(self.__subject__, attr)
return bool(self.__subject__)
return self.__subject__[arg]
self.__subject__[arg] = val
del self.__subject__[arg]
return self.__subject__[i:j]
self.__subject__[i:j] = val
del self.__subject__[i:j]
return ob in self.__subject__
name))
('lt', '<'), ('gt', '>'), ('le', '<='), ('ge', '>='), ('eq', '=='), ('ne', '!=') ]:
('or', '|'), ('and', '&'), ('xor', '^'), ('lshift', '<<'), ('rshift', '>>'), ('add', '+'), ('sub', '-'), ('mul', '*'), ('div', '/'), ('mod', '%'), ('truediv', '/'), ('floordiv', '//') ]: "def __%(name)s__(self,ob):\n" " return self.__subject__ %(op)s ob\n" "\n" "def __r%(name)s__(self,ob):\n" " return ob %(op)s self.__subject__\n" "\n" "def __i%(name)s__(self,ob):\n" " self.__subject__ %(op)s=ob\n" " return self\n" ) % locals())
# Oddball signatures
return divmod(ob, self.__subject__)
return pow(self.__subject__, *args)
self.__subject__ **= ob return self
return pow(ob, self.__subject__)
try: return get_cache(self) except AttributeError: set_cache(self, get_callback(self)()) return get_cache(self)
|