#NEWLINE# def to_str( self , registry = True , tag = True , explicit_tag = False , explicit_namespace = False ) : #NEWLINE# #INDENT# if ( self . repo is None ) : #NEWLINE# #INDENT# raise RuntimeError ( 'No image repository specified' ) #NEWLINE# #UNINDENT# result = self . repo #NEWLINE# if ( tag and self . tag ) : #NEWLINE# #INDENT# result = '{0}:{1}' . format ( result , self . tag ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( tag and explicit_tag ) : #NEWLINE# #INDENT# result = '{0}:{1}' . format ( result , 'latest' ) #NEWLINE# #UNINDENT# #UNINDENT# if self . namespace : #NEWLINE# #INDENT# result = '{0}/{1}' . format ( self . namespace , result ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if explicit_namespace : #NEWLINE# #INDENT# result = '{0}/{1}' . format ( 'library' , result ) #NEWLINE# #UNINDENT# #UNINDENT# if ( registry and self . registry ) : #NEWLINE# #INDENT# result = '{0}/{1}' . format ( self . registry , result ) #NEWLINE# #UNINDENT# return result