moved posts.json folder to config/posts.json
This commit is contained in:
@@ -50,15 +50,15 @@ def main(reddit, posts: dict):
|
|||||||
time.sleep(config.interval)
|
time.sleep(config.interval)
|
||||||
|
|
||||||
def load_posts():
|
def load_posts():
|
||||||
if not os.path.exists("posts.json"):
|
if not os.path.exists("config/posts.json"):
|
||||||
with open("posts.json", "w+") as file:
|
with open("config/posts.json", "w+") as file:
|
||||||
json.dump({}, file)
|
json.dump({}, file)
|
||||||
with open("posts.json", "r+") as file:
|
with open("config/posts.json", "r+") as file:
|
||||||
data = json.load(file)
|
data = json.load(file)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def save_posts(data):
|
def save_posts(data):
|
||||||
with open('posts.json', 'w+') as file:
|
with open('config/posts.json', 'w+') as file:
|
||||||
json.dump(data, file)
|
json.dump(data, file)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user