From 20ec8c38c2fc05838be66be74360ce220c7c5b76 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Thu, 23 Jun 2022 22:59:09 -0700 Subject: [PATCH] Fixes Add importlib_metadata to requirements.txt Add comments stating origin of new parser --- comicapi/filenamelexer.py | 6 ++++-- comicapi/filenameparser.py | 2 ++ requirements.txt | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/comicapi/filenamelexer.py b/comicapi/filenamelexer.py index 0fbd329..f37e483 100644 --- a/comicapi/filenamelexer.py +++ b/comicapi/filenamelexer.py @@ -1,3 +1,5 @@ +# Extracted and mutilated from https://github.com/lordwelch/wsfmt +# Which was extracted and mutliated from https://github.com/golang/go/tree/master/src/text/template/parse from __future__ import annotations import calendar @@ -11,10 +13,10 @@ class ItemType(Enum): Error = auto() # Error occurred; value is text of error EOF = auto() Text = auto() # Text - LeftParen = auto() # '(' inside action + LeftParen = auto() Number = auto() # Simple number IssueNumber = auto() # Preceded by a # Symbol - RightParen = auto() # ')' inside action + RightParen = auto() Space = auto() # Run of spaces separating arguments Dot = auto() LeftBrace = auto() diff --git a/comicapi/filenameparser.py b/comicapi/filenameparser.py index 9e7879b..cf125c0 100644 --- a/comicapi/filenameparser.py +++ b/comicapi/filenameparser.py @@ -331,6 +331,8 @@ class FilenameInfo(TypedDict, total=False): eof = filenamelexer.Item(filenamelexer.ItemType.EOF, -1, "") +# Extracted and mutilated from https://github.com/lordwelch/wsfmt +# Which was extracted and mutliated from https://github.com/golang/go/tree/master/src/text/template/parse class Parser: """docstring for FilenameParser""" diff --git a/requirements.txt b/requirements.txt index c94cf9b..f39d387 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ beautifulsoup4 >= 4.1 +importlib_metadata natsort>=8.1.0 pathvalidate pillow>=4.3.0