From 38e94da5431df262da7a34e2114fae8946b95d84 Mon Sep 17 00:00:00 2001 From: octospacc Date: Wed, 13 Apr 2022 09:20:45 +0200 Subject: [PATCH] Remove debug lines' --- Data.md => Source/Data.md | 0 Generate.py => Source/Generate.py | 47 ++++++++----------------------- Style.css => Source/Style.css | 0 Source/requirements.txt | 1 + 4 files changed, 12 insertions(+), 36 deletions(-) rename Data.md => Source/Data.md (100%) rename Generate.py => Source/Generate.py (87%) rename Style.css => Source/Style.css (100%) create mode 100644 Source/requirements.txt diff --git a/Data.md b/Source/Data.md similarity index 100% rename from Data.md rename to Source/Data.md diff --git a/Generate.py b/Source/Generate.py similarity index 87% rename from Generate.py rename to Source/Generate.py index 79d566f..c34c2f6 100644 --- a/Generate.py +++ b/Source/Generate.py @@ -71,12 +71,12 @@ from markdown import Markdown def SplitPop(String, Key): List = String.split(Key) - for s in range(len(List)-1): - if not List[s]: - List.pop(s) + for i,s in enumerate(List): + if not s: + List.pop(i) return List -def GetData(): +def GetDataHTML(): Path = 'Data.md' try: with open(Path, 'r') as f: @@ -87,18 +87,10 @@ def GetData(): def GetBoards(Data): Boards = SplitPop(Data, '<{}>'.format(MainHeading)) - #if not Boards[0]: - # Boards.pop(0) - - #print(Boards) - + for b in range(len(Boards)): - #print(Boards[b]) - #Boards += ['

' + b] - #Boards.pop(0) Boards[b] = '<{}>'.format(MainHeading) + Boards[b] - - #print(Boards) + return Boards def GenBoard(Data): @@ -111,7 +103,7 @@ def GenBoard(Data): TITLE=Elements[0], CONTENT=Elements[1] ) - + return Board def WriteHTML(Info, Boards): @@ -120,16 +112,13 @@ def WriteHTML(Info, Boards): HTMLBoards = '' for b in Boards: HTMLBoards += GenBoard(b) - - #print(Info) - print(HTMLBoards) - + Title = SplitPop( SplitPop( Info, '<{}>'.format(MainHeading))[0], ''.format(MainHeading))[0] - + try: with open(Path, 'w') as f: f.write( @@ -138,11 +127,6 @@ def WriteHTML(Info, Boards): TITLE=Title, INFO=Info, BOARDS=HTMLBoards)) - - #BODY=BoardHTML.format( - # TITLE="", - # CONTENT="" - #))) return True except Exception: raise @@ -150,19 +134,10 @@ def WriteHTML(Info, Boards): exit(1) def Main(): - Data = GetData() - Boards = GetBoards(Data) - - #print(Data) - print(Boards) - + Boards = GetBoards(GetDataHTML()) Info = Boards[0] Boards.pop(0) - - print(Info) - print(Boards) - WriteHTML(Info, Boards) if __name__ == '__main__': - Main() \ No newline at end of file + Main() diff --git a/Style.css b/Source/Style.css similarity index 100% rename from Style.css rename to Source/Style.css diff --git a/Source/requirements.txt b/Source/requirements.txt new file mode 100644 index 0000000..0918c97 --- /dev/null +++ b/Source/requirements.txt @@ -0,0 +1 @@ +markdown