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