def handle_setup(last_step):
 if (last_step < 0):
  return
 last_step = (last_step or 0)
 setup_queue = [create_objects, create_channels, at_initial_setup, reset_server]
 for (num, setup_func) in enumerate(setup_queue[last_step:]):
  try:
   setup_func()
  except Exception:
   if ((last_step + num) == 1):
    from evennia.objects.models import ObjectDB
    for obj in ObjectDB.objects.all():
     obj.delete()
   elif ((last_step + num) == 2):
    from evennia.comms.models import ChannelDB
    ChannelDB.objects.all().delete()
   raise
  ServerConfig.objects.conf('last_initial_setup_step', ((last_step + num) + 1))
 ServerConfig.objects.conf('last_initial_setup_step', (-1))

def handle_setup ( last_step ) : if ( last_step < 0 ) : return last_step = ( last_step or 0 ) setup_queue = [ create_objects , create_channels , at_initial_setup , reset_server ] for ( num , setup_func ) in enumerate ( setup_queue [ last_step : ] ) : try : setup_func ( ) except Exception : if ( ( last_step + num ) == 1 ) : from evennia . objects . models import ObjectDB for obj in ObjectDB . objects . all ( ) : obj . delete ( ) elif ( ( last_step + num ) == 2 ) : from evennia . comms . models import ChannelDB ChannelDB . objects . all ( ) . delete ( ) raise ServerConfig . objects . conf ( 'last_initial_setup_step' , ( ( last_step + num ) + 1 ) ) ServerConfig . objects . conf ( 'last_initial_setup_step' , ( - 1 ) )
main logic for the module .