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