def fortune(self):
        try:
           self.textinput2.text += cowsay(fortune.get_random_fortune('fortunes'))
        except:
           self.textinput2.text += "install fortune"                  


        pass
Esempio n. 2
0
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'
Esempio n. 3
0
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')
Esempio n. 5
0
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')
Esempio n. 6
0
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)"
Esempio n. 8
0
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)
Esempio n. 9
0
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"                  
Esempio n. 11
0
 def __init__(self, *args, **kwargs):
     result = finders.find('fortune/generic_fortunes1')
     self.cookie = "<br>".join(
         fortune.get_random_fortune(result).split("\n"))
Esempio n. 12
0
def raw_fortune():
    return get_random_fortune('cookies.dat')
Esempio n. 13
0
    def fortune(self):
        #print cowsay(fortune.get_random_fortune('fortunes'))  
        self.textinput2.text += cowsay(fortune.get_random_fortune('starwars'))                  

        pass