def fortune(self): try: self.textinput2.text += cowsay(fortune.get_random_fortune('fortunes')) except: self.textinput2.text += "install fortune" pass
def cookie_cb(bot, *args, **kwargs): ''' Return a cookie-related quote. ''' try: return fortune.get_random_fortune(SPECIALS['cookie.spc']) except KeyError: LOGGER.error('Specials file was not loaded!') return 'Error!\xf0\x9f\x8d\xaa'
def fortune_cb(bot, *args, **kwargs): ''' Return a random quote from one of the quote files. ''' try: source = random.choice(FORTUNE_FILES) return fortune.get_random_fortune(source) except ValueError as ex: LOGGER.error('Fortune failed: %s', ex) return _('Be the quote you want to see on a wall.\n -- Error 20XX')
def eightball_cb(bot, *args, **kwargs): ''' Provide certainty in a turbulent world. Accuracy not guaranteed. ''' try: return fortune.get_random_fortune(SPECIALS['eightball.spc']) except KeyError: LOGGER.error('Eightball specials not loaded!') return "Sorry, you're out of luck. (ERROR)"
def eightball_cb(bot, *args, **kwargs): ''' Provide certainty in a turbulent world. Accuracy not guaranteed. ''' try: return fortune.get_random_fortune( SPECIALS['eightball.spc']) except KeyError: LOGGER.error('Eightball specials not loaded!') return "Sorry, you're out of luck. (ERROR)"
def returnQuote(): if 'uid' in request.args: print hashSet uid = request.args['uid'] while True: quote = fortune.get_random_fortune(FORTUNE_PATH) uidHash = hash(str(uid) + str(quote)) print uidHash if not uidHash in hashSet: print 'uid hash not in hash set' break hashSet.add(uidHash) data = {'quote': quote} return jsonify(data)
def lars_cb(bot, message, *args, **kwargs): ''' Send a (bad) genderless pickupline to sender. ''' return fortune.get_random_fortune(SPECIALS['pickupline.spc'])
def starwars(self): try: self.textinput2.text += cowsay(fortune.get_random_fortune('starwars')) except: self.textinput2.text += "install fortune"
def __init__(self, *args, **kwargs): result = finders.find('fortune/generic_fortunes1') self.cookie = "<br>".join( fortune.get_random_fortune(result).split("\n"))
def raw_fortune(): return get_random_fortune('cookies.dat')
def fortune(self): #print cowsay(fortune.get_random_fortune('fortunes')) self.textinput2.text += cowsay(fortune.get_random_fortune('starwars')) pass