Browse Source

Updated the quote script to contain more ascii art!

pull/17/head
jrtechs 5 years ago
parent
commit
b163e9876a
10 changed files with 104 additions and 6 deletions
  1. +0
    -1
      README.md
  2. +8
    -0
      src/asciiArt/bat.txt
  3. +7
    -0
      src/asciiArt/dolphin.txt
  4. +13
    -0
      src/asciiArt/fish.txt
  5. +7
    -0
      src/asciiArt/llama.txt
  6. +8
    -0
      src/asciiArt/roo.txt
  7. +11
    -0
      src/asciiArt/squirrel.txt
  8. +22
    -0
      src/asciiArt/voodoo.txt
  9. +16
    -5
      src/quote.py
  10. +12
    -0
      src/utils/module.py

+ 0
- 1
README.md View File

@ -17,7 +17,6 @@
roosay is a simple python script which displays an ascii roo with a quote above it
## Usage
```
python3 roosay.py Super cool message

+ 8
- 0
src/asciiArt/bat.txt View File

@ -0,0 +1,8 @@
\
/\ \ /\
/ \\'._ (\_/) _.'/ \
|.''._'--(o.o)--'_.''.|
\_ / `;=/ " \=;` \ _/
`\__| \___/ |__/`
\(_|_)/
" ` "

+ 7
- 0
src/asciiArt/dolphin.txt View File

@ -0,0 +1,7 @@
\
\ _../|_
='__ _~-.
\' ~-`\._
|/~`
. . . . . . .
._.`(._.`(_.`(._.`(._.`(._.`(._.`(._

+ 13
- 0
src/asciiArt/fish.txt View File

@ -0,0 +1,13 @@
\
\ _,;_;/-",_
\ ,") ( ((O) " .`,
,` ( ) ; -.,/;`}
," o ( ( ( . -_-.
`. ; ; ) ) \`; \;
`., ) ( ( _-` \,'
"`'-,,`.jb
) ) / `, .' ( ( `, .'
( ( }/ ) ) }/
) ) ' ( ( '
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

+ 7
- 0
src/asciiArt/llama.txt View File

@ -0,0 +1,7 @@
\
\ __/ \\
\ <-/ l'>
// ** ll
ll---ll\ llama~
ll ll || ||
^^ ^^ '' ''

+ 8
- 0
src/asciiArt/roo.txt View File

@ -0,0 +1,8 @@
\
\ /)/)
\ (ø.ø)
\ ( />
__/ _\ //
'~( '~ )//
_\ '}/
\"--~(/

+ 11
- 0
src/asciiArt/squirrel.txt View File

@ -0,0 +1,11 @@
\
\ _
\ .-'` `}
\ _./) / }
.'o \ | }
'.___.'`.\ {`
/`\_/ , `. }
\=' .-' _`\ {
`'`;/ `, }
_\ ; }
/__`;-...'--'

+ 22
- 0
src/asciiArt/voodoo.txt View File

@ -0,0 +1,22 @@
\
\ ,
\ ._ \/, ,|_
\ -\| \|;|,'_
\ `_\|\|;/-.
\ `_\\|/._
,'__ __`.
/ /_ | | _\ \
/ ((o)| |(o)) \
| `--/ \--' |
,--. `. '-' ,'
(O..O) `.uuuuu,'
\==/ _|nnnnn|_
.'||`. ,-' \_____/ `-.
_||,-' | | `.
(__) _,-. ; | .'. `.
(___)' |__/___\__| \(__)
(__) ::::::::::: (___)
|| ::::::::::::: (__)
|| :::::::::::::
__| | | _ |__
(_(_(_,' '._)_)_)

+ 16
- 5
src/quote.py View File

@ -8,8 +8,12 @@ Jeffery Russell
import random
import sys
import os.path
import glob
from utils import module
from utils import print_message_bubble
import roosay
import configuration
@ -17,14 +21,21 @@ import configuration
"""Path to a text file containing quotes"""
INPUT_FILE = configuration.get_config()["quotes"]
"""Pulls a list of the ascii art file names"""
BASE_FILE = os.path.dirname(__file__)
ASCII_ART = glob.glob(BASE_FILE + "/asciiArt/*.txt")
def print_roosay_message(message):
def print_message(message):
"""
Calls the roosay command that prints an ascii roo with a message above it
Prints a dialog box with a message in it with an ascii
animal below it
:param message: a quote to print
:return:
:return: NA
"""
roosay.roo_say(message)
print_message_bubble.print_message(message)
print(module.input_file_with_new_line(
ASCII_ART[random.randint(0,(len(ASCII_ART) -1))]))
def print_usage():
@ -75,7 +86,7 @@ def main():
if len(quotes) == 0:
print("Quotes file : " + INPUT_FILE + " is empty.")
else:
print_roosay_message(quotes[random.randint(0,(len(quotes) -1))])
print_message(quotes[random.randint(0,(len(quotes) -1))])
"""

+ 12
- 0
src/utils/module.py View File

@ -18,6 +18,18 @@ def input_file(file_name):
f.append(line.strip(' \t\n\r'))
return f
def input_file_with_new_line(file_name):
"""
Reads an entire file and returns the contents as a string
"""
f = ""
with open(file_name.strip('\n')) as file:
for line in file:
f = f + line
return f
def check_file_exists(fileloc):
"""
Function which checks to see if a file exists

Loading…
Cancel
Save