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

Function end_session

brainworkshop.py:4044–4069  ·  view source on GitHub ↗
(cancelled=False)

Source from the content-addressed store, hash-verified

4042
4043# this function handles the finish or cancellation of a session.
4044def end_session(cancelled=False):
4045 for label in input_labels:
4046 label.delete()
4047 while input_labels:
4048 input_labels.remove(input_labels[0])
4049 if cancelled:
4050 mode.session_number -= 1
4051 if not cancelled:
4052 stats.sessions_today += 1
4053 for visual in visuals: visual.hide()
4054 mode.started = False
4055 mode.paused = False
4056 circles.update()
4057 field.crosshair_update()
4058 reset_input()
4059 if cancelled:
4060 update_all_labels()
4061 else:
4062 update_all_labels(do_analysis = True)
4063 if cfg.PANHANDLE_FREQUENCY:
4064 statsfile_path = os.path.join(get_data_dir(), cfg.STATSFILE)
4065 statsfile = open(statsfile_path, 'r')
4066 sessions = len(statsfile.readlines()) # let's just hope people
4067 statsfile.close() # don't manually edit their statsfiles
4068 if (sessions % cfg.PANHANDLE_FREQUENCY) == 0 and not CLINICAL_MODE:
4069 Panhandle(n=sessions)
4070
4071
4072

Callers 2

on_key_pressFunction · 0.85
updateFunction · 0.85

Calls 9

reset_inputFunction · 0.85
update_all_labelsFunction · 0.85
get_data_dirFunction · 0.85
PanhandleClass · 0.85
deleteMethod · 0.80
crosshair_updateMethod · 0.80
hideMethod · 0.45
updateMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected