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

Method __init__

brainworkshop.py:3590–3667  ·  view source on GitHub ↗
(self, n=-1)

Source from the content-addressed store, hash-verified

3588
3589class Panhandle:
3590 def __init__(self, n=-1):
3591 paragraphs = [
3592_("""
3593You have completed %i sessions with Brain Workshop. Your perseverance suggests \
3594that you are finding some benefit from using the program. If you have been \
3595benefiting from Brain Workshop, don't you think Brain Workshop should \
3596benefit from you?
3597""") % n,
3598_("""
3599Brain Workshop is and always will be 100% free. Up until now, Brain Workshop \
3600as a project has succeeded because a very small number of people have each \
3601donated a huge amount of time to it. It would be much better if the project \
3602were supported by small donations from a large number of people. Do your \
3603part. Donate.
3604"""),
3605_("""
3606As of March 2010, Brain Workshop has been downloaded over 75,000 times in 20 \
3607months. If each downloader donated an average of $1, we could afford to pay \
3608decent full- or part-time salaries (as appropriate) to all of our developers, \
3609and we would be able to buy advertising to help people learn about Brain \
3610Workshop. With $2 per downloader, or with more downloaders, we could afford \
3611to fund controlled experiments and clinical trials on Brain Workshop and \
3612cognitive training. Help us make that vision a reality. Donate.
3613"""),
3614_("""
3615The authors think it important that access to cognitive training \
3616technologies be available to everyone as freely as possible. Like other \
3617forms of education, cognitive training should not be a luxury of the rich, \
3618since that would tend to exacerbate class disparity and conflict. Charging \
3619money for cognitive training does exactly that. The commercial competitors \
3620of Brain Workshop have two orders of magnitude more users than does Brain \
3621Workshop because they have far more resources for research, development, and \
3622marketing. Help us bridge that gap and improve social equality of \
3623opportunity. Donate.
3624"""),
3625_("""
3626Brain Workshop has many known bugs and missing features. The developers \
3627would like to fix these issues, but they also have to work in order to be \
3628able to pay for rent and food. If you think the developers' time is better \
3629spent programming than serving coffee, then do something about it. Donate.
3630"""),
3631_("""
3632Press SPACE to continue, or press D to donate now.
3633""")] # feel free to add more paragraphs or to change the chances for the
3634 # paragraphs you like and dislike, etc.
3635 chances = [-1, 10, 10, 10, 10, 0] # if < 0, 100% chance of being included. Otherwise, relative weight.
3636 # if == 0, appended to end and not counted
3637 # for target_len.
3638 assert len(chances) == len(paragraphs)
3639 target_len = 3
3640 text = []
3641 options = []
3642 for i in range(len(chances)):
3643 if chances[i] < 0:
3644 text.append(i)
3645 else:
3646 options.extend([i]*chances[i])
3647 while len(text) < target_len and len(options) > 0:

Callers

nothing calls this directly

Calls 4

on_drawMethod · 0.95
calc_fontsizeFunction · 0.85
width_centerFunction · 0.85
height_centerFunction · 0.85

Tested by

no test coverage detected