Account for unrevealed exchange/challenge fics, change some wording

master
trémeur 2 years ago
parent 48534c366f
commit 6b0112dc26

@ -1,4 +1,4 @@
import os
import datetime, os
from importlib import import_module
fffandoms = ["FF1","FF2","FF3","FF4","FF5","FF6","FF7","FF8","FF9","FFX","FF11","FF12","FF13","FF14","FF15"]
@ -29,6 +29,14 @@ def charlist(local=False):
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
ficfile = "originalsmeta." + ficcountstring
fileread = import_module(ficfile)
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
if len(fileread.fandom) == 1:
if fandom in fileread.fandom:
try:
@ -74,6 +82,14 @@ def charlist(local=False):
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
countfile = "originalsmeta." + ficcountstring
fileread = import_module(countfile)
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
if searchfandom in fileread.fandom:
# append to lists
try:

@ -24,6 +24,14 @@ def eventlist(local=False):
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
ficfile = "originalsmeta." + ficcountstring
fileread = import_module(ficfile)
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
try:
events.append({"name":fileread.eventname,"location":fileread.eventlocation,"sortname":fileread.eventname.lower()})
except:
@ -52,6 +60,14 @@ def eventlist(local=False):
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
countfile = "originalsmeta." + ficcountstring
fileread = import_module(countfile)
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
try:
if fileread.eventname == theevent:
evententries.append({"ficno":ficcount,"year":(fileread.datewords[0])["date"].year,"fandom":fileread.fandom})

@ -26,6 +26,10 @@ def feedgen(local=False):
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
ficfile = "originalsmeta." + ficcountstring
fileread = import_module(ficfile)
try:
if fileread.revealdate <= datetime.datetime.now():
datelist.append(fileread.revealdate)
except:
for instalment in fileread.datewords:
datelist.append(instalment["date"])
elif os.path.exists("translationsmeta/" + ficcountstring + ".py"):
@ -52,6 +56,12 @@ def feedgen(local=False):
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
ficfile = "originalsmeta." + ficcountstring
fileread = import_module(ficfile)
try:
if fileread.revealdate <= datetime.datetime.now():
if fileread.revealdate == date:
if targetfile == 0:
targetfile = ficfile
except:
for instalment in fileread.datewords:
if instalment["date"] == date:
if targetfile == 0:
@ -69,6 +79,10 @@ def feedgen(local=False):
thefile = import_module(targetfile)
filewrite = open("build/feed.xml", "a")
filewrite.write("<item>\n<title>")
try:
if thefile.revealdate == True:
pass
except:
if (thefile.datewords[0])["date"] != date:
filewrite.write("Updated: ")
filewrite.write("Fic " + ficcountstring)
@ -150,7 +164,7 @@ def feedgen(local=False):
filewrite.write(futuredate.strftime("%a, %-d %b %Y"))
filewrite.write(" 00:00:00 UT</pubDate>\n<link>")
if local:
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/masterlist")
filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/masterlist/index.html")
else:
filewrite.write("https://tre.praze.net/fic/masterlist")
filewrite.write("#fic" + ficcountstring + "</link>\n<guid isPermaLink=\"false\">praze-fic-" + ficcountstring)

@ -9,7 +9,7 @@ def indexgen(local=False):
# write header
headerfooter.headerwrite("build/index.html","Trés fic archive","Trés fic archive","",True,local)
filewrite = open("build/index.html", "a")
filewrite.write("<p>Here is all my fanfiction! Its also archived at AO3 under the name <span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/ovely/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\" /></a><a href=\"https://archiveofourown.org/users/ovely/pseuds/ovely\"><b>ovely</b></a></span>.</p>\n<p>Ive recently implemented comments read about that <a href=\"")
filewrite.write("<p>Here is all my fanfiction! Much of it is also archived at AO3 under the name <span style=\"white-space: nowrap;\" class=\"ljuser\"><a href=\"https://archiveofourown.org/users/ovely/profile\"><img src=\"https://p.dreamwidth.org/b164c54b26e4/-/archiveofourown.org/favicon.ico\" alt=\"[archiveofourown.org profile]\" width=\"16\" height=\"16\" style=\"vertical-align: text-bottom; border: 0; padding-right: 1px;\" /></a><a href=\"https://archiveofourown.org/users/ovely/pseuds/ovely\"><b>ovely</b></a></span>.</p>\n<p>Ive recently implemented comments read about that <a href=\"")
if local:
filewrite.write("comments/index.html")
else:

@ -36,6 +36,14 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
transread = import_module(translationfile)
except:
pass
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
# write to output file
filewrite = open(output, "a")
filewrite.write("<div class=\"fic\"")
@ -390,11 +398,14 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
filewrite.write("href=\"/fic/files/")
filewrite.write(ficnostring + ".epub\">EPUB</a></li>\n")
# write ao3 link if there is one
try:
if fileread.ao3slug:
filewrite.write("<li class=\"ao3link\"><a ")
if fileread.locked:
filewrite.write("class=\"locked\" ")
filewrite.write("href=\"https://archiveofourown.org/works/" + str(fileread.ao3slug) + "\">AO3</a></li>\n")
except:
pass
# determine if comments page
if any(item in fffandoms for item in fileread.fandom):
filewrite.write("<li class=\"prazelink\"><a href=\"")
@ -498,11 +509,14 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
filewrite.write("href=\"/fic/files/")
filewrite.write(translationstring + ".epub\">EPUB</a></li>\n")
# write ao3 link if there is one
try:
if fileread.ao3slug:
filewrite.write("<li class=\"ao3link\"><a ")
if fileread.locked:
filewrite.write("class=\"locked\" ")
filewrite.write("href=\"https://archiveofourown.org/works/" + str(transread.ao3slug) + "\">AO3</a></li>\n")
except:
pass
# determine if comments page required
if any(item in fffandoms for item in fileread.fandom):
filewrite.write("<li class=\"prazelink\"><a href=\"")

@ -13,7 +13,7 @@ def listgen(local=False):
if os.path.exists("build/masterlist/index.html"):
os.remove("build/masterlist/index.html")
# write header
headerfooter.headerwrite("build/masterlist/index.html","Masterlist","Fic masterlist","<p>On this page, from newest to oldest, youll find basically everything Ive ever written that is a. fanfiction and b. extant; quality may vary. RPF and things I wrote before 2020 require a username and password to access; on AO3, theyre available behind the login wall.</p>",False,local)
headerfooter.headerwrite("build/masterlist/index.html","Masterlist","Fic masterlist","<p>On this page, from newest to oldest, youll find basically everything Ive ever written that is a. fanfiction and b. extant; quality may vary. RPF and things I wrote before 2020 require a username and password to access; if theyre on AO3, theyre available behind the login wall.</p>",False,local)
# write fic divs
ficcount = 500
while ficcount > 0:

@ -5,6 +5,7 @@ showtitle = False
language = "en"
# translation =
datewords = [{"date":datetime.datetime(YYYY,M,D),"words":}]
# revealdate = datetime.datetime(YYYY,M,D)
# approxdate = ""
status = "complete" # incomplete, abandoned
rating = "" # g, t, m, e

@ -1,4 +1,4 @@
import os
import datetime, os
from importlib import import_module
fffandoms = ["FF1","FF2","FF3","FF4","FF5","FF6","FF7","FF8","FF9","FFX","FF11","FF12","FF13","FF14","FF15"]
@ -29,6 +29,14 @@ def shiplist(local=False):
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
ficfile = "originalsmeta." + ficcountstring
fileread = import_module(ficfile)
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
if len(fileread.fandom) == 1:
if fandom in fileread.fandom:
try:
@ -62,6 +70,14 @@ def shiplist(local=False):
if os.path.exists("originalsmeta/" + ficcountstring + ".py"):
countfile = "originalsmeta." + ficcountstring
fileread = import_module(countfile)
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
if searchfandom in fileread.fandom:
# append to lists
try:

@ -230,6 +230,14 @@ def yeargen(local=False):
else:
fileread = False
if fileread:
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
for date in fileread.datewords:
yearlist.append(date["date"].year)
yearlist = sorted(list(dict.fromkeys(yearlist)))
@ -267,6 +275,14 @@ def yeargen(local=False):
else:
fileread = False
if fileread:
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
for date in fileread.datewords:
if (date["date"]).year == year:
allfics.append(ficcountstring)
@ -281,6 +297,14 @@ def yeargen(local=False):
else:
fileread = False
if fileread:
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
try:
fandom = fileread.fandom
event = fileread.event
@ -514,6 +538,14 @@ def yeargen(local=False):
else:
fileread = False
if fileread:
try:
if fileread.revealdate > datetime.datetime.now():
revealed = False
else:
revealed = True
except:
revealed = True
if revealed == True:
for datewords in fileread.datewords:
if datewords["date"] == thedate:
thewords = datewords["words"]

Loading…
Cancel
Save