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