Store all user data in a folder

This commit is contained in:
mez 2024-08-06 19:37:17 +01:00
parent f92d6fab53
commit d3d579840a
19 changed files with 84 additions and 151 deletions

18
feed.py
View file

@ -23,8 +23,8 @@ def feedgen(local=False):
ficcountstring = "0" + str(ficcount)
else:
ficcountstring = str(ficcount)
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
ficfile = "originalsmeta." + ficcountstring
if os.path.exists("files/originalsmeta/" + ficcountstring + ".py"):
ficfile = "files.originalsmeta." + ficcountstring
fileread = import_module(ficfile)
try:
if fileread.revealdate <= datetime.datetime.now():
@ -32,8 +32,8 @@ def feedgen(local=False):
except:
for instalment in fileread.datewords:
datelist.append(instalment["date"])
elif os.path.exists("translationsmeta/" + ficcountstring + ".py"):
ficfile = "translationsmeta." + ficcountstring
elif os.path.exists("files/translationsmeta/" + ficcountstring + ".py"):
ficfile = "files.translationsmeta." + ficcountstring
fileread = import_module(ficfile)
for instalment in fileread.datewords:
datelist.append(instalment["date"])
@ -53,8 +53,8 @@ def feedgen(local=False):
else:
ficcountstring = str(ficcount)
targetfile = 0
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
ficfile = "originalsmeta." + ficcountstring
if os.path.exists("files/originalsmeta/" + ficcountstring + ".py"):
ficfile = "files.originalsmeta." + ficcountstring
fileread = import_module(ficfile)
try:
if fileread.revealdate <= datetime.datetime.now():
@ -66,8 +66,8 @@ def feedgen(local=False):
if instalment["date"] == date:
if targetfile == 0:
targetfile = ficfile
elif os.path.exists("translationsmeta/" + ficcountstring + ".py"):
transfile = "translationsmeta." + ficcountstring
elif os.path.exists("files/translationsmeta/" + ficcountstring + ".py"):
transfile = "files.translationsmeta." + ficcountstring
transread = import_module(transfile)
for instalment in transread.datewords:
if instalment["date"] == date:
@ -90,7 +90,7 @@ def feedgen(local=False):
filewrite.write (" (French)")
filewrite.write(": ")
try:
origfile = "originalsmeta." + str(thefile.original)
origfile = "files.originalsmeta." + str(thefile.original)
origread = import_module(origfile)
try:
filewrite.write(origread.fandomtext)