#NEWLINE# def save_config( self , download = False ) : #NEWLINE# #INDENT# path = os . path . join ( MEDIA_ROOT , 'mods' , self . mod . title ) #NEWLINE# config = TwConfig ( os . path . join ( path , 'servers' , self . owner . username , '{0}' . format ( self . id ) , self . random_key , 'generated.cfg' ) ) #NEWLINE# for option in self . config_options . all ( ) : #NEWLINE# #INDENT# if ( option . widget == Option . WIDGET_SELECT ) : #NEWLINE# #INDENT# value = option . value . split ( ',' , 1 ) [ 0 ] #NEWLINE# widget = 'select:{0}' . format ( option . value . split ( ',' , 1 ) [ 1 ] ) #NEWLINE# config . add_option ( option . command , value , widget ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( download and ( option . widget == Option . WIDGET_PASSWORD ) ) : #NEWLINE# #INDENT# config . add_option ( option . command , '' , option . get_widget_display ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# config . add_option ( option . command , option . value , option . get_widget_display ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if download : #NEWLINE# #INDENT# config . add_option ( 'sv_port' , '8303' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# config . add_option ( 'sv_port' , self . port . port ) #NEWLINE# config . add_option ( 'ec_port' , self . port . port ) #NEWLINE# config . add_option ( 'ec_password' , 'uptee' ) #NEWLINE# #UNINDENT# for tune in self . config_tunes . all ( ) : #NEWLINE# #INDENT# config . add_tune ( tune . command , tune . value ) #NEWLINE# #UNINDENT# for vote in self . config_votes . all ( ) : #NEWLINE# #INDENT# config . add_vote ( vote . command , vote . title ) #NEWLINE# #UNINDENT# for rcon_command in self . config_rconcommands . all ( ) : #NEWLINE# #INDENT# config . add_rcon_command ( rcon_command . command , rcon_command . value ) #NEWLINE# #UNINDENT# config . write ( )