@ -90,26 +90,27 @@ def charlist(local=False):
except :
revealed = True
if revealed == True :
ficdict = { " thefic " : ficcount , " thedate " : ( fileread . datewords [ - 1 ] ) [ " date " ] }
if searchfandom in fileread . fandom :
# append to lists
try :
if character in fileread . charpov :
povcount . append ( fic coun t)
povcount . append ( fic di ct)
except :
pass
try :
if character in fileread . charmain :
maincount . append ( fic coun t)
maincount . append ( fic di ct)
except :
pass
try :
if character in fileread . charsecondary :
secondarycount . append ( fic coun t)
secondarycount . append ( fic di ct)
except :
pass
try :
if character in fileread . charmention :
mentioncount . append ( fic coun t)
mentioncount . append ( fic di ct)
except :
pass
# write details element
@ -132,25 +133,41 @@ def charlist(local=False):
filewrite = open ( output , " a " )
filewrite . write ( " <h1>POV character</h1> \n " )
filewrite . close ( )
povcount = sorted ( povcount , key = lambda d : d [ " thedate " ] , reverse = True )
newpov = [ ]
for fic in povcount :
newpov . append ( fic [ " thefic " ] )
for fic in newpov :
makeheader . ficgen ( fic , False , output , local )
if len ( maincount ) > 0 :
filewrite = open ( output , " a " )
filewrite . write ( " <h1>Main character</h1> \n " )
filewrite . close ( )
maincount = sorted ( maincount , key = lambda d : d [ " thedate " ] , reverse = True )
newmain = [ ]
for fic in maincount :
newmain . append ( fic [ " thefic " ] )
for fic in newmain :
makeheader . ficgen ( fic , False , output , local )
if len ( secondarycount ) > 0 :
filewrite = open ( output , " a " )
filewrite . write ( " <h1>Secondary character</h1> \n " )
filewrite . close ( )
secondarycount = sorted ( secondarycount , key = lambda d : d [ " thedate " ] , reverse = True )
newsecondary = [ ]
for fic in secondarycount :
newsecondary . append ( fic [ " thefic " ] )
for fic in newsecondary :
makeheader . ficgen ( fic , False , output , local )
if len ( mentioncount ) > 0 :
filewrite = open ( output , " a " )
filewrite . write ( " <h1>Mentioned</h1> \n " )
filewrite . close ( )
mentioncount = sorted ( mentioncount , key = lambda d : d [ " thedate " ] , reverse = True )
newmention = [ ]
for fic in mentioncount :
newmention . append ( fic [ " thefic " ] )
for fic in newmention :
makeheader . ficgen ( fic , False , output , local )
filewrite = open ( output , " a " )
filewrite . write ( " </details> \n " )