From 9fa87b59559628a9a2be6974f52e30a6436e77dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sun, 4 Aug 2024 13:21:11 +0100 Subject: [PATCH] =?UTF-8?q?Account=20for=20local=20filesystem=20change;=20?= =?UTF-8?q?change=20wording=20on=20gateway=20page;=20add=20link=20to=20tei?= =?UTF-8?q?=E2=80=99s=20ficring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feed.py | 2 +- headerfooter.py | 10 +++++----- indexgen.py | 4 ++-- makeheader.py | 44 ++++++++++++++++++++++---------------------- single.py | 2 +- statsgen.py | 6 +++--- verifygen.py | 4 ++-- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/feed.py b/feed.py index 657b0e5..8f245a0 100644 --- a/feed.py +++ b/feed.py @@ -164,7 +164,7 @@ def feedgen(local=False): filewrite.write(futuredate.strftime("%a, %-d %b %Y")) filewrite.write(" 00:00:00 GMT\n") if local: - filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/") + filewrite.write("/home/mdd/Documents/proj/fic-archive/build/") else: filewrite.write("https://tre.praze.net/fic/") filewrite.write("single/" + ficcountstring) diff --git a/headerfooter.py b/headerfooter.py index 85caf0a..4d71ba8 100644 --- a/headerfooter.py +++ b/headerfooter.py @@ -2,14 +2,14 @@ def headerwrite(output,title,headerone,desc,main=False,local=False): header = open(output, "a") header.write("\n\n\n\n\n\n\n\n\n" + title + "\n\n\n\n
\n
\n\n

" + headerone + "

\n" + desc + "\n") if not main: header.write("

\nmain page\n\n

\n") @@ -22,18 +22,18 @@ def footerwrite(output,main=False,local=False): if not main: footer.write("

\nmain page\n\n

\n") footer.write("\n\n
\n\n\n") diff --git a/indexgen.py b/indexgen.py index 0a1ae7e..ba6c3ac 100644 --- a/indexgen.py +++ b/indexgen.py @@ -38,7 +38,7 @@ def statslist(local=False): for year in yearlist: statstring = "" if local == True: - statspath = "/home/mdd/Documents/drive/proj/fic-archive/build/stats/" + str(year) + "/index.html" + statspath = "/home/mdd/Documents/proj/fic-archive/build/stats/" + str(year) + "/index.html" else: statspath = "/fic/stats/" + str(year) if yearlist.index(year) > 0: @@ -96,7 +96,7 @@ def indexgen(local=False): filewrite.write("events/index.html") else: filewrite.write("/fic/events") - filewrite.write("\">Events\n

I’ve been participating in fandom exchanges and other events since late 2020. Most fics I write these days that aren’t in FF fandoms are in this category (although a lot of the FF ones are as well).

\n
\n
\n

Other

\n\n
\n") + filewrite.write("\">Events\n

I’ve been participating in fandom exchanges and other events since late 2020. Most fics I write these days that aren’t in FF fandoms are in this category (although a lot of the FF ones are as well).

\n\n
\n

Other

\n\n
\n
\n\n
\n") filewrite.close() headerfooter.footerwrite("build/index.html",True,local) diff --git a/makeheader.py b/makeheader.py index 7ceb279..f163959 100644 --- a/makeheader.py +++ b/makeheader.py @@ -50,12 +50,12 @@ def linkgen(ficno,output="output.html",local=False): if fileread.locked: filewrite.write("class=\"locked\" href=\"") if local: - filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/") + filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/") else: filewrite.write("/fic/secret/") else: if local: - filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/") + filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/") else: filewrite.write("href=\"/fic/files/") filewrite.write(ficnostring + ".html\">HTML\n") @@ -65,12 +65,12 @@ def linkgen(ficno,output="output.html",local=False): if fileread.locked: filewrite.write("class=\"locked\" href=\"") if local: - filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/") + filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/") else: filewrite.write("/fic/secret/") else: if local: - filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/") + filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/") else: filewrite.write("href=\"/fic/files/") filewrite.write(ficnostring + ".pdf\">PDF\n") @@ -80,12 +80,12 @@ def linkgen(ficno,output="output.html",local=False): if fileread.locked: filewrite.write("class=\"locked\" href=\"") if local: - filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/") + filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/") else: filewrite.write("/fic/secret/") else: if local: - filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/") + filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/") else: filewrite.write("href=\"/fic/files/") filewrite.write(ficnostring + ".epub\">EPUB\n") @@ -111,7 +111,7 @@ def linkgen(ficno,output="output.html",local=False): if any(item in fffandoms for item in fileread.fandom): filewrite.write("
  • comments
  • \n") @@ -120,7 +120,7 @@ def linkgen(ficno,output="output.html",local=False): if timeelapsed.days < 730: filewrite.write("
  • comments
  • \n") @@ -129,7 +129,7 @@ def linkgen(ficno,output="output.html",local=False): if fileread.event == "ao3exchange" and (fileread.datewords[0])["date"].year > 2019: filewrite.write("
  • comments
  • \n") @@ -138,7 +138,7 @@ def linkgen(ficno,output="output.html",local=False): if fileread.comments: filewrite.write("
  • comments
  • \n") @@ -149,7 +149,7 @@ def linkgen(ficno,output="output.html",local=False): if fileread.comments: filewrite.write("
  • comments
  • \n") @@ -170,12 +170,12 @@ def linkgen(ficno,output="output.html",local=False): if fileread.locked: filewrite.write("class=\"locked\" href=\"") if local: - filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/") + filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/") else: filewrite.write("/fic/secret/") else: if local: - filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/") + filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/") else: filewrite.write("href=\"/fic/files/") filewrite.write(translationstring + ".html\">HTML\n") @@ -185,12 +185,12 @@ def linkgen(ficno,output="output.html",local=False): if fileread.locked: filewrite.write("class=\"locked\" href=\"") if local: - filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/") + filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/") else: filewrite.write("/fic/secret/") else: if local: - filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/") + filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/") else: filewrite.write("href=\"/fic/files/") filewrite.write(translationstring + ".pdf\">PDF\n") @@ -200,12 +200,12 @@ def linkgen(ficno,output="output.html",local=False): if fileread.locked: filewrite.write("class=\"locked\" href=\"") if local: - filewrite.write("/home/mdd/Documents/drive/proj/fic-archive/build/secret/") + filewrite.write("/home/mdd/Documents/proj/fic-archive/build/secret/") else: filewrite.write("/fic/secret/") else: if local: - filewrite.write("href=\"/home/mdd/Documents/drive/proj/fic-archive/build/files/") + filewrite.write("href=\"/home/mdd/Documents/proj/fic-archive/build/files/") else: filewrite.write("href=\"/fic/files/") filewrite.write(translationstring + ".epub\">EPUB\n") @@ -222,7 +222,7 @@ def linkgen(ficno,output="output.html",local=False): if any(item in fffandoms for item in fileread.fandom): filewrite.write("
  • comments
  • \n") @@ -231,7 +231,7 @@ def linkgen(ficno,output="output.html",local=False): if timeelapsed.days < 730: filewrite.write("
  • comments
  • \n") @@ -240,7 +240,7 @@ def linkgen(ficno,output="output.html",local=False): if transread.comments: filewrite.write("
  • comments
  • \n") @@ -290,7 +290,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False): filewrite.write(" id=\"fic" + ficnostring + "\"") filewrite.write(">\n

    no. " + ficnostring + "") @@ -298,7 +298,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False): if translationstring: filewrite.write("/" + translationstring + "") diff --git a/single.py b/single.py index 2bfa069..70aee38 100644 --- a/single.py +++ b/single.py @@ -46,7 +46,7 @@ def singlepage(ficno,directory,local=False): filewrite = open(output, "a") filewrite.write("\n
    \n") diff --git a/statsgen.py b/statsgen.py index 0614b60..db6669d 100644 --- a/statsgen.py +++ b/statsgen.py @@ -165,7 +165,7 @@ def ficsum(ficcount,year,month=0,showfandom=True,local=False): ficstring = "" ficstring += "« " + str(prevyear) + "") @@ -747,7 +747,7 @@ def yeargen(local=False): nextyear = yearlist[listposition + 1] filewrite.write("" + str(nextyear) + " »") diff --git a/verifygen.py b/verifygen.py index a3f6ddf..9ba6951 100644 --- a/verifygen.py +++ b/verifygen.py @@ -9,9 +9,9 @@ def verifygen(local=False): # write header headerfooter.headerwrite("build/verify/index.html","Tré’s fic archive","Warning","",True,local) filewrite = open("build/verify/index.html", "a") - filewrite.write("

    Please note before proceeding:

    \n

    Some of my fanfiction is NSFW (ranging from slightly obscene language to explicit sex scenes), some is RPF, and some of it contains mature or potentially objectionable themes (death, suicide, mental illness, incest …). Ratings and warnings are given accordingly, don’t like don’t read. If you happen to be under 18, kindly gtfo and read some real literature instead. Honestly, it will be much more edifying.

    \n\n\n\n
    \n\n\n\n\n\n\n\n")