#NEWLINE# def build_remove_spawn( self , args , player = None ) : #NEWLINE# #INDENT# exp = '(?P<spawn_num>\\d+)' #NEWLINE# match = re . match ( exp , args , re . I ) #NEWLINE# if ( not match ) : #NEWLINE# #INDENT# return 'Type "help spawns" to get help using this command.\n' #NEWLINE# #UNINDENT# spawn_id = match . group ( 'spawn_num' ) #NEWLINE# if ( spawn_id in self . spawns ) : #NEWLINE# #INDENT# spawn = self . spawns [ spawn_id ] #NEWLINE# del self . spawns [ spawn_id ] #NEWLINE# if ( spawn . container and ( spawn . container . id in self . spawns ) ) : #NEWLINE# #INDENT# self . spawns [ spawn . container . id ] . remove_nested_spawn ( spawn ) #NEWLINE# #UNINDENT# message = ( 'Room spawn %s has been removed.\n' % spawn_id ) #NEWLINE# dependents = ', ' . join ( [ sub_spawn . id for sub_spawn in spawn . nested_spawns ] ) #NEWLINE# for sub_spawn in spawn . nested_spawns : #NEWLINE# #INDENT# sub_spawn . destruct ( ) #NEWLINE# del self . spawns [ sub_spawn . id ] #NEWLINE# #UNINDENT# spawn . destruct ( ) #NEWLINE# if dependents : #NEWLINE# #INDENT# message += ( ( 'The following nested spawns were also removed: ' + dependents ) + '.\n' ) #NEWLINE# #UNINDENT# return message #NEWLINE# #UNINDENT# return ( "Room spawn #%s doesn't exist.\n" % spawn_id )