def get_game_dir_path():
 for i in range(10):
  gpath = os.getcwd()
  if ('server' in os.listdir(gpath)):
   if os.path.isfile(os.path.join('server', 'conf', 'settings.py')):
    return gpath
  else:
   os.chdir(os.pardir)
 raise RuntimeError('server/conf/settings.py not found: Must start from inside game dir.')

def get_game_dir_path ( ) : for i in range ( 10 ) : gpath = os . getcwd ( ) if ( 'server' in os . listdir ( gpath ) ) : if os . path . isfile ( os . path . join ( 'server' , 'conf' , 'settings.py' ) ) : return gpath else : os . chdir ( os . pardir ) raise RuntimeError ( 'server/conf/settings.py not found: Must start from inside game dir.' )
this is called by settings_default in order to determine the path of the game directory .