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