#NEWLINE# def set_status( self , new_status ) : #NEWLINE# #INDENT# '\n        Set a new status for this line\n\n        If the requested status is not valid, then ``InvalidLineStatus`` is\n        raised.\n        ' #NEWLINE# if ( new_status == self . status ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( new_status not in self . available_statuses ( ) ) : #NEWLINE# #INDENT# raise exceptions . InvalidLineStatus ( ( _ ( "'%(new_status)s' is not a valid status (current status: '%(status)s')" ) % { #NEWLINE# #INDENT# 'new_status' : new_status , #NEWLINE# 'status' : self . status , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# self . status = self #NEWLINE# self . save ( )