From 90a3fece83f1a6d3d020412f397836a050a5135e Mon Sep 17 00:00:00 2001 From: jrtechs Date: Sun, 8 Oct 2017 18:53:17 -0400 Subject: [PATCH] Minor tweaks --- src/quote.py | 13 ++++++++++++- src/roosay.py | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/quote.py b/src/quote.py index 2b76728..f0fb663 100644 --- a/src/quote.py +++ b/src/quote.py @@ -9,7 +9,9 @@ Jeffery Russell import subprocess import random import module +import roosay +"""Path to a text file containing quotes""" INPUT_FILE = "/home/jeff/scripts/quotes.txt" @@ -22,6 +24,14 @@ def print_cowsay_message(message): subprocess.call(["cowsay", message]) +def print_roosay_message(message): + """ + Calls the roosay command that prints an ascii roo with a message above it + :param message: a quote to print + :return: + """ + roosay.roo_say(message) + def main(): """ This function calls the welcome function, then it calls the cowsay function with a random quote. @@ -29,7 +39,8 @@ def main(): """ quotes = module.input_file(INPUT_FILE) - print_cowsay_message(quotes[random.randint(0,(len(quotes) -1))]) + #print_cowsay_message(quotes[random.randint(0,(len(quotes) -1))]) + print_roosay_message(quotes[random.randint(0,(len(quotes) -1))]) """ diff --git a/src/roosay.py b/src/roosay.py index d8d509b..df31af8 100644 --- a/src/roosay.py +++ b/src/roosay.py @@ -14,6 +14,8 @@ def main(): """ message = "" for i in range(1, len(sys.argv)): + if len(message) > 0: + message += " " message += sys.argv[i] roo_say(message) @@ -98,7 +100,7 @@ def print_roo(): """ -If ran from command line this will call main which looks for command line arguments +If ran from command line, this will call the main which looks for command line arguments """ if __name__ == '__main__': main() \ No newline at end of file