peter@146
|
1 |
from flask.ext.babel import gettext as _
|
peter@141
|
2 |
from random import shuffle
|
peter@141
|
3 |
|
peter@141
|
4 |
def get_saying():
|
peter@146
|
5 |
sayings = [(_('The Zen of Python, by Tim Peters'), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
6 |
(_("Beautiful is better than ugly."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
7 |
(_("Explicit is better than implicit."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
8 |
(_("Simple is better than complex."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
9 |
(_("Complex is better than complicated."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
10 |
(_("Flat is better than nested."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
11 |
(_("Sparse is better than dense."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
12 |
(_("Readability counts."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
13 |
(_("Special cases aren't special enough to break the rules."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
14 |
(_("Although practicality beats purity."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
15 |
(_("Errors should never pass silently."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
16 |
(_("Unless explicitly silenced."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
17 |
(_("In the face of ambiguity, refuse the temptation to guess."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
18 |
(_("Although that way may not be obvious at first unless you're Dutch."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
19 |
(_("Now is better than never."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
20 |
(_("Although never is often better than *right* now."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
21 |
(_("If the implementation is hard to explain, it's a bad idea."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
22 |
(_("If the implementation is easy to explain, it may be a good idea."), _('__Tim Peters, The Zen of Python')),
|
peter@146
|
23 |
(_("Namespaces are one honking great idea -- let's do more of those!"), _('__Tim Peters, The Zen of Python')),
|
peter@144
|
24 |
]
|
peter@144
|
25 |
|
peter@141
|
26 |
shuffle(sayings)
|
peter@144
|
27 |
|
peter@141
|
28 |
saying, author = sayings[0]
|
peter@141
|
29 |
return saying, author
|