#NEWLINE# def lazy_property_factory( lazy_property ) : #NEWLINE# #INDENT# 'Create properties that perform lazy loading of attributes.' #NEWLINE# def lazy_property_getter( self ) : #NEWLINE# #INDENT# if ( not hasattr ( self , ( '_' + lazy_property ) ) ) : #NEWLINE# #INDENT# self . load ( ) #NEWLINE# #UNINDENT# if ( not hasattr ( self , ( '_' + lazy_property ) ) ) : #NEWLINE# #INDENT# raise ValueError ( "{} wasn't loaded" . format ( lazy_property ) ) #NEWLINE# #UNINDENT# return getattr ( self , ( '_' + lazy_property ) ) #NEWLINE# #UNINDENT# def lazy_property_setter( self , value ) : #NEWLINE# #INDENT# setattr ( self , ( '_' + lazy_property ) , value ) #NEWLINE# #UNINDENT# return ( lazy_property_getter , lazy_property_getter )