#NEWLINE# @ property #NEWLINE# def value( self ) : #NEWLINE# #INDENT# 'The list of values wrapped by this option.\n\n        The list of values is rendered and resolved on access type. For this,\n        the options ``render_context`` must be set. This context is then used\n        to render any string value as a template.\n\n        :getter: Returns the fully rendered and resolved list of current values\n        :setter: Set the current option value\n        :type: single object or list of objects\n        ' #NEWLINE# values = self . _value #NEWLINE# if ctx . render_context : #NEWLINE# #INDENT# from jip.templates import render_template #NEWLINE# rendered = [ ] #NEWLINE# ctx = self . render_context #NEWLINE# for value in values : #NEWLINE# #INDENT# if isinstance ( value , basestring ) : #NEWLINE# #INDENT# v = render_template ( value , ** ctx ) #NEWLINE# rendered . append ( v ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( value , Option ) : #NEWLINE# #INDENT# v = value . value #NEWLINE# if ( self . _index < 0 ) : #NEWLINE# #INDENT# rendered . extend ( v ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# rendered . append ( v [ ( self . _index if ( self . _index < len ( v ) ) else 0 ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# rendered . append ( value ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( self . default is not None ) and isinstance ( self . default , basestring ) ) : #NEWLINE# #INDENT# self . default = render_template ( self . default , ** ctx ) #NEWLINE# #UNINDENT# self . render_context = None #NEWLINE# self . _value = rendered #NEWLINE# #UNINDENT# if ( ( self . default is not None ) and ( len ( self . _value ) == 0 ) ) : #NEWLINE# #INDENT# if isinstance ( self . default , ( list , tuple ) ) : #NEWLINE# #INDENT# values = [ ] #NEWLINE# values . extend ( self . default ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# values = [ self . default ] #NEWLINE# #UNINDENT# #UNINDENT# return values