From 48534c366fbcc39aa3f00827c1e53c3381ed5760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Thu, 15 Jun 2023 23:33:52 +0100 Subject: [PATCH] Add code for showing comment replies; show characters in stats page summaries for shipfic if no named ship --- commentpage.py | 4 ++++ statsgen.py | 28 ++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/commentpage.py b/commentpage.py index ae42a43..fdd9d62 100644 --- a/commentpage.py +++ b/commentpage.py @@ -110,6 +110,10 @@ def commentpage(ficno,directory,local=False): except: pass filewrite.write("\n

" + comment["text"] + "

\n\n") + try: + filewrite.write("
\n

Reply

\n

" + comment["reply"] + "

\n
") + except: + pass except: pass if fffandom or timeelapsed.days < 730: diff --git a/statsgen.py b/statsgen.py index 6a50b69..e994d29 100644 --- a/statsgen.py +++ b/statsgen.py @@ -41,7 +41,19 @@ def ficsum(ficcount,year,month=0,showfandom=True,local=False): try: thechars = origfile.ship[0] except: - pass + chars = [] + try: + chars.extend(origfile.charpov) + except: + pass + try: + chars.extend(origfile.charmain) + except: + pass + if chars != []: + thechars = ", ".join(chars) + else: + thechars = "" else: chars = [] try: @@ -64,7 +76,19 @@ def ficsum(ficcount,year,month=0,showfandom=True,local=False): try: thechars = fileread.ship[0] except: - pass + chars = [] + try: + chars.extend(fileread.charpov) + except: + pass + try: + chars.extend(fileread.charmain) + except: + pass + if chars != []: + thechars = ", ".join(chars) + else: + thechars = "" else: chars = [] try: