Exemple #1
0
def read_weather():
    # Currently, weather will be a dictionary with a comment, temp, and max.
    location = settings.get_preference('location')
    w = get_weather(location)
    say('The weather for %s includes %s' % (location, w['comment']))
    say('It is currently %d. Expect it to get %.2f degrees warmer' %
        (w['temp'], w['max'] - w['temp']))
Exemple #2
0
def read_weather():
    # Currently, weather will be a dictionary with a comment, temp, and max.
    location = settings.get_preference('location')
    w = get_weather(location)
    say('The weather for %s includes %s' %(location, w['comment']))
    say('It is currently %d. Expect it to get %.2f degrees warmer'
        %(w['temp'], w['max'] - w['temp']))
Exemple #3
0
from speech import say
from tweets import get_tweets
from weather import get_weather
import settings


def read_tweets(user, tweets):
    for tweet in tweets:
        say('%s tweeted %s' % (user, tweet))


def read_weather():
    # Currently, weather will be a dictionary with a comment, temp, and max.
    location = settings.get_preference('location')
    w = get_weather(location)
    say('The weather for %s includes %s' % (location, w['comment']))
    say('It is currently %d. Expect it to get %.2f degrees warmer' %
        (w['temp'], w['max'] - w['temp']))


def tweets(username, count=2):
    return get_tweets(username, count)


if __name__ == '__main__':
    handles = settings.get_preference('tweets')
    for user in handles:
        t = tweets(user, 1)
        read_tweets(user, t)
    read_weather()
Exemple #4
0
from speech import say
from tweets import get_tweets
from weather import get_weather
import settings

def read_tweets(user, tweets):
    for tweet in tweets:
        say('%s tweeted %s' %(user, tweet))

def read_weather():
    # Currently, weather will be a dictionary with a comment, temp, and max.
    location = settings.get_preference('location')
    w = get_weather(location)
    say('The weather for %s includes %s' %(location, w['comment']))
    say('It is currently %d. Expect it to get %.2f degrees warmer'
        %(w['temp'], w['max'] - w['temp']))

def tweets(username, count=2):
    return get_tweets(username, count)


if __name__ == '__main__':
    handles = settings.get_preference('tweets')
    for user in handles:
        t = tweets(user, 1)
        read_tweets(user, t)
    read_weather()
Exemple #5
0
 def testLotsOfSpaces(self):
     import settings
     settings.initialize('testsettings')
     handles = settings.get_preference('tweet_lots_space')
     desired = ['stevenjarvis', 'allieehenry']
     self.assertEqual(handles, desired)
Exemple #6
0
 def testGetName(self):
     import settings
     settings.initialize('testsettings')
     self.assertEqual(settings.get_preference('name'), 'steve')