|
|
|
@ -50,7 +50,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
# give the div an id if requested
|
|
|
|
|
if unique:
|
|
|
|
|
filewrite.write(" id=\"fic" + ficnostring + "\"")
|
|
|
|
|
filewrite.write(">\n<h1><span class=\"ficno\">" + ficnostring)
|
|
|
|
|
filewrite.write(">\n<h1><span class=\"ficnoprelim\">no. </span><span class=\"ficno\">" + ficnostring)
|
|
|
|
|
# write ficno including translation if there is one
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("/" + translationstring)
|
|
|
|
@ -73,8 +73,8 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
if fileread.status == "abandoned":
|
|
|
|
|
filewrite.write(" <span class=\"abandoned\"></span>")
|
|
|
|
|
filewrite.write("</h1>\n<ul class=\"ficmeta\">\n<li class=\"ficdate\">")
|
|
|
|
|
filewrite.write(" <span class=\"abandoned\"> (abandoned)</span>")
|
|
|
|
|
filewrite.write("</h1>\n<ul class=\"ficmeta\">\n<li class=\"ficdate\"><i>Date:</i> ")
|
|
|
|
|
# write date, date range if ranged or translation
|
|
|
|
|
if fileread.status == "incomplete":
|
|
|
|
|
filewrite.write((fileread.datewords[0])["date"].strftime("%-d %B %Y") + "–")
|
|
|
|
@ -112,7 +112,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
sumwords = 0
|
|
|
|
|
for instalment in fileread.datewords:
|
|
|
|
|
sumwords = sumwords + instalment["words"]
|
|
|
|
|
filewrite.write("</li>\n<li class=\"wordcount\">" + str(sumwords))
|
|
|
|
|
filewrite.write("</li>\n<li class=\"wordcount\"><i>Wordcount:</i> " + str(sumwords))
|
|
|
|
|
transwords = 0
|
|
|
|
|
try:
|
|
|
|
|
for instalment in transread.datewords:
|
|
|
|
@ -121,13 +121,22 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
# write rating
|
|
|
|
|
filewrite.write("</li>\n<li class=\"rating\"><span class=\"" + fileread.rating + "\">")
|
|
|
|
|
filewrite.write("</li>\n<li class=\"rating\"><i>Rating: </i><span class=\"" + fileread.rating + "\">")
|
|
|
|
|
if fileread.rating == "g":
|
|
|
|
|
filewrite.write("general")
|
|
|
|
|
elif fileread.rating == "t":
|
|
|
|
|
filewrite.write("teen")
|
|
|
|
|
elif fileread.rating == "m":
|
|
|
|
|
filewrite.write("mature")
|
|
|
|
|
elif fileread.rating == "e":
|
|
|
|
|
filewrite.write("explicit")
|
|
|
|
|
filewrite.write("</span>")
|
|
|
|
|
# write reason for rating if there is one
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write(" (" + fileread.ratingreason + ")")
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
filewrite.write("</span></li>\n<li class=\"fandom\">")
|
|
|
|
|
filewrite.write("</span></li>\n<li class=\"fandom\"><i>Fandom: </i>")
|
|
|
|
|
# write fandom
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write(fileread.fandomtext)
|
|
|
|
@ -136,10 +145,10 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
filewrite.write("</li>\n")
|
|
|
|
|
# write characters in pov, main, secondary categories, if they exist
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<li class=\"characters\">" + fileread.charactertext + "</li>\n")
|
|
|
|
|
filewrite.write("<li class=\"characters\"><i>Characters: </i>" + fileread.charactertext + "</li>\n")
|
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<li class=\"characters\">" + ", ".join(fileread.charpov))
|
|
|
|
|
filewrite.write("<li class=\"characters\"><i>Characters: </i>" + ", ".join(fileread.charpov))
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write(", " + ", ".join(fileread.charmain))
|
|
|
|
|
except:
|
|
|
|
@ -151,7 +160,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
filewrite.write("</li>\n")
|
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<li class=\"characters\">" + ", ".join(fileread.charmain))
|
|
|
|
|
filewrite.write("<li class=\"characters\"><i>Characters: </i>" + ", ".join(fileread.charmain))
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write(", " + "<small>" + ", ".join(fileread.charsecondary) + "</small>")
|
|
|
|
|
except:
|
|
|
|
@ -163,23 +172,23 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
# write genre
|
|
|
|
|
filewrite.write("<li class=\"genre\">" + ", ".join(fileread.genre) + "</li>\n")
|
|
|
|
|
filewrite.write("<li class=\"genre\"><i>Genre: </i>" + ", ".join(fileread.genre) + "</li>\n")
|
|
|
|
|
# write warnings if they exist
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<li class=\"warnings\">" + fileread.warnings + "</li>\n")
|
|
|
|
|
filewrite.write("<li class=\"warnings\"><i>Warnings: </i>" + fileread.warnings + "</li>\n")
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
# write point in canon if there is one
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<li class=\"time\">" + fileread.time + "</li>\n")
|
|
|
|
|
filewrite.write("<li class=\"time\"><i>Point in canon: </i>" + fileread.time + "</li>\n")
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
# write locations if there are any
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<li class=\"location\">" + fileread.locationtext + "</li>\n")
|
|
|
|
|
filewrite.write("<li class=\"location\"><i>Location: </i>" + fileread.locationtext + "</li>\n")
|
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<li class=\"location\">" + ", ".join(fileread.location) + "</li>\n")
|
|
|
|
|
filewrite.write("<li class=\"location\"><i>Location: </i>" + ", ".join(fileread.location) + "</li>\n")
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
filewrite.write("</ul>\n")
|
|
|
|
@ -187,26 +196,26 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
try:
|
|
|
|
|
if transread.language == "en":
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<p class=\"summary\">" + transread.summary)
|
|
|
|
|
filewrite.write("<p class=\"summary\"><i>Summary: </i>" + transread.summary)
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write(" " + fileread.summary + "</p>\n")
|
|
|
|
|
except:
|
|
|
|
|
filewrite.write("</p>\n")
|
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<p class=\"summary\">" + fileread.summary + "</p>\n")
|
|
|
|
|
filewrite.write("<p class=\"summary\"><i>Summary: </i>" + fileread.summary + "</p>\n")
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
elif transread.language == "fr":
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<p class=\"summary\">" + fileread.summary)
|
|
|
|
|
filewrite.write("<p class=\"summary\"><i>Summary: </i>" + fileread.summary)
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write(" " + transread.summary + "</p>\n")
|
|
|
|
|
except:
|
|
|
|
|
filewrite.write("</p>\n")
|
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
filewrite.write("<p class=\"summary\">" + transread.summary + "</p>\n")
|
|
|
|
|
filewrite.write("<p class=\"summary\"><i>Summary: </i>" + transread.summary + "</p>\n")
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
except:
|
|
|
|
@ -221,14 +230,14 @@ def ficgen(ficno,unique=False,output="output.html",local=False):
|
|
|
|
|
juvenilia = False
|
|
|
|
|
try:
|
|
|
|
|
if fileread.notes:
|
|
|
|
|
filewrite.write("<p class=\"note\">")
|
|
|
|
|
filewrite.write("<p class=\"note\"><i>Notes: </i>")
|
|
|
|
|
except:
|
|
|
|
|
try:
|
|
|
|
|
if fileread.event:
|
|
|
|
|
filewrite.write("<p class=\"note\">")
|
|
|
|
|
filewrite.write("<p class=\"note\"><i>Notes: </i>")
|
|
|
|
|
except:
|
|
|
|
|
if juvenilia:
|
|
|
|
|
filewrite.write("<p class=\"note\">")
|
|
|
|
|
filewrite.write("<p class=\"note\"><i>Notes: </i>")
|
|
|
|
|
# if juvenilia, add age
|
|
|
|
|
if juvenilia:
|
|
|
|
|
age = relativedelta((fileread.datewords[0])["date"], datetime.datetime(1993,6,28)).years
|
|
|
|
|