Browse Source

Minor tweaks

pull/1/head
Jeffery Russell 7 years ago
parent
commit
90a3fece83
2 changed files with 15 additions and 2 deletions
  1. +12
    -1
      src/quote.py
  2. +3
    -1
      src/roosay.py

+ 12
- 1
src/quote.py View File

@ -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))])
"""

+ 3
- 1
src/roosay.py View File

@ -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()

Loading…
Cancel
Save