Esempio n. 1
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("name", type=str,
                        help="Your Name")
    parser.add_argument("area", type=str,
                        help="Area where you live")
    parser.add_argument("-n", "--news", action="store_true",
                        help="")
    cat_help = 'love, inspiring, art, funny, sports, life, management'
    parser.add_argument("-c", "--category", action="store",
                        help=cat_help)

    args = parser.parse_args()
    name = args.name
    area = args.area
    print(day)
    w = Weather(area)

    if args.news:
        n2 = news()
    else:
        n2 = ''

    if args.category:
        a = vars(args)
        quote_of_day = give_quote(a['category'])

    else:
        quote_of_day = give_quote()

    quote_of_day = "Todays quote of the day. {} by {}. ".format(
                        quote_of_day['quote'], quote_of_day['author'])

    morning = Morning(name,
                      area, w.weather_combine(), quote_of_day, news=n2)

    print(subprocess.call('echo Creating MP3 ...', shell=True))
    morning.create_mp3(morning.create_greeting())
    print(morning.greeting)
Esempio n. 2
0
 def get_weather(self):
     weather = Weather(self.area)
     self.weather = weather.weather_combine()
     return self.weather