MCPcopy Create free account
hub / github.com/brain-workshop/brainworkshop / set_user

Function set_user

brainworkshop.py:4372–4395  ·  view source on GitHub ↗
(newuser)

Source from the content-addressed store, hash-verified

4370 update_all_labels()
4371
4372def set_user(newuser):
4373 global cfg
4374 global USER
4375 global CONFIGFILE
4376 USER = newuser
4377 if USER.lower() == 'default':
4378 CONFIGFILE = 'config.ini'
4379 else:
4380 CONFIGFILE = USER + '-config.ini'
4381 rewrite_configfile(CONFIGFILE, overwrite=False)
4382 cfg = parse_config(CONFIGFILE)
4383 stats.initialize_session()
4384 stats.parse_statsfile()
4385 if len(stats.full_history) > 0 and not cfg.JAEGGI_MODE:
4386 mode.mode = stats.full_history[-1][1]
4387 stats.retrieve_progress()
4388 # text labels also need to be remade; until that's done, this remains commented out
4389 #if cfg.BLACK_BACKGROUND:
4390 # glClearColor(0, 0, 0, 1)
4391 #else:
4392 # glClearColor(1, 1, 1, 1)
4393 window.set_fullscreen(cfg.WINDOW_FULLSCREEN) # window size needs to be changed
4394 update_all_labels()
4395 save_last_user('defaults.ini')
4396
4397
4398def get_users():

Callers 1

chooseMethod · 0.85

Calls 7

rewrite_configfileFunction · 0.85
parse_configFunction · 0.85
update_all_labelsFunction · 0.85
save_last_userFunction · 0.85
initialize_sessionMethod · 0.80
parse_statsfileMethod · 0.80
retrieve_progressMethod · 0.80

Tested by

no test coverage detected