From 96ae9b486e1ed252d5e8189f9b2dce5976675531 Mon Sep 17 00:00:00 2001 From: Gavin Inglis Date: Mon, 3 Feb 2020 23:48:26 -0500 Subject: [PATCH] restructure all text files into subdirectory --- modules/bachelor.py | 2 +- modules/detain.py | 8 ++++---- modules/dierre_pics.py | 4 ++-- modules/penny.py | 2 +- modules/tethics_dare.py | 4 ++-- bachelor.txt => txt/bachelor.txt | 0 dares.txt => txt/dares.txt | 0 detainHistory.json => txt/detainHistory.json | 0 dierre_pics.txt => txt/dierre_pics.txt | 0 dierre_quotes.txt => txt/dierre_quotes.txt | 0 penny.txt => txt/penny.txt | 0 tethics_roster.txt => txt/tethics_roster.txt | 0 12 files changed, 10 insertions(+), 10 deletions(-) rename bachelor.txt => txt/bachelor.txt (100%) rename dares.txt => txt/dares.txt (100%) rename detainHistory.json => txt/detainHistory.json (100%) rename dierre_pics.txt => txt/dierre_pics.txt (100%) rename dierre_quotes.txt => txt/dierre_quotes.txt (100%) rename penny.txt => txt/penny.txt (100%) rename tethics_roster.txt => txt/tethics_roster.txt (100%) diff --git a/modules/bachelor.py b/modules/bachelor.py index 5af8f52..931d123 100644 --- a/modules/bachelor.py +++ b/modules/bachelor.py @@ -2,7 +2,7 @@ def bachelor_handler(sender, message, bot_id, app_id): if '!roseceremony' in message or '!bachelor' in message: - with open("bachelor.txt") as f: + with open("txt/bachelor.txt") as f: candidates = [] for line in f: line = line.strip() diff --git a/modules/detain.py b/modules/detain.py index e5d9a7b..244e0b6 100644 --- a/modules/detain.py +++ b/modules/detain.py @@ -21,7 +21,7 @@ def detain_handler(sender, message, bot_id, app_id): def getN(user): user = ''.join(user) - with open('detainHistory.json', 'r') as f: + with open('txt/detainHistory.json', 'r') as f: history = json.load(f) if user in history: return history[user] @@ -29,7 +29,7 @@ def getN(user): def writeDetain(user): user = ' '.join(user) - with open('detainHistory.json', 'r') as f: + with open('txt/detainHistory.json', 'r') as f: history = json.load(f) if user in history: @@ -37,14 +37,14 @@ def writeDetain(user): else: history[user] = '1' - with open('detainHistory.json', 'w') as f: + with open('txt/detainHistory.json', 'w') as f: json.dump(history, f) def detainList(): historyStr = [] - with open('detainHistory.json', 'r') as f: + with open('txt/detainHistory.json', 'r') as f: history = json.load(f) for name in history: diff --git a/modules/dierre_pics.py b/modules/dierre_pics.py index 4c2f28c..7c7b93f 100644 --- a/modules/dierre_pics.py +++ b/modules/dierre_pics.py @@ -27,7 +27,7 @@ def upload_image_to_groupme(imgURL, app_id): return imageurl def dierre_pic_handler(sender, message, bot_id, app_id): - with open('dierre_pics.txt') as f: + with open('txt/dierre_pics.txt') as f: images = [] for line in f: images.append(line.strip()) @@ -36,7 +36,7 @@ def dierre_pic_handler(sender, message, bot_id, app_id): def dierre_quote(): quotes = [] - with open('dierre_quotes.txt') as f: + with open('txt/dierre_quotes.txt') as f: for line in f: quotes.append(line.strip()) return quotes[random.randrange(len(quotes))] diff --git a/modules/penny.py b/modules/penny.py index a05d6ab..64730ab 100644 --- a/modules/penny.py +++ b/modules/penny.py @@ -27,7 +27,7 @@ def upload_image_to_groupme(imgURL, app_id): return imageurl def penny_pic_handler(sender, message, bot_id, app_id): - with open('penny.txt') as f: + with open('txt/penny.txt') as f: images = [] for line in f: images.append(line.strip()) diff --git a/modules/tethics_dare.py b/modules/tethics_dare.py index 889fec0..f5fd93a 100644 --- a/modules/tethics_dare.py +++ b/modules/tethics_dare.py @@ -16,7 +16,7 @@ def dare_handler(sender, message, bot_id, app_id): def random_classmate(): roster = [] - with open('tethics_roster.txt') as f: + with open('txt/tethics_roster.txt') as f: for line in f: roster.append(line.strip()) return roster[random.randrange(len(roster))] @@ -24,7 +24,7 @@ def random_classmate(): def tehics_dares(): dares = [] - with open('dares.txt') as f: + with open('txt/dares.txt') as f: for line in f: dares.append(line.strip()) return dares[random.randrange(len(dares))] diff --git a/bachelor.txt b/txt/bachelor.txt similarity index 100% rename from bachelor.txt rename to txt/bachelor.txt diff --git a/dares.txt b/txt/dares.txt similarity index 100% rename from dares.txt rename to txt/dares.txt diff --git a/detainHistory.json b/txt/detainHistory.json similarity index 100% rename from detainHistory.json rename to txt/detainHistory.json diff --git a/dierre_pics.txt b/txt/dierre_pics.txt similarity index 100% rename from dierre_pics.txt rename to txt/dierre_pics.txt diff --git a/dierre_quotes.txt b/txt/dierre_quotes.txt similarity index 100% rename from dierre_quotes.txt rename to txt/dierre_quotes.txt diff --git a/penny.txt b/txt/penny.txt similarity index 100% rename from penny.txt rename to txt/penny.txt diff --git a/tethics_roster.txt b/txt/tethics_roster.txt similarity index 100% rename from tethics_roster.txt rename to txt/tethics_roster.txt