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