2015-02-21 18:30:32 -08:00
|
|
|
"""A class for internal metadata storage
|
|
|
|
|
|
|
|
The goal of this class is to handle ALL the data that might come from various
|
|
|
|
tagging schemes and databases, such as ComicVine or GCD. This makes conversion
|
|
|
|
possible, however lossy it might be
|
2015-02-16 04:27:21 -08:00
|
|
|
|
|
|
|
"""
|
2024-01-29 09:14:25 -08:00
|
|
|
|
2023-02-16 17:23:13 -08:00
|
|
|
# Copyright 2012-2014 ComicTagger Authors
|
2022-06-02 18:32:16 -07:00
|
|
|
#
|
2015-02-21 18:30:32 -08:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
2022-06-02 18:32:16 -07:00
|
|
|
#
|
2015-02-21 18:30:32 -08:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2022-06-02 18:32:16 -07:00
|
|
|
#
|
2015-02-21 18:30:32 -08:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2022-06-02 18:32:16 -07:00
|
|
|
from __future__ import annotations
|
2015-02-16 04:27:21 -08:00
|
|
|
|
2022-07-18 09:00:56 -07:00
|
|
|
import copy
|
|
|
|
import dataclasses
|
2022-04-04 18:59:26 -07:00
|
|
|
import logging
|
2023-11-05 21:36:29 -08:00
|
|
|
from collections.abc import Sequence
|
2024-07-19 16:18:57 -07:00
|
|
|
from typing import TYPE_CHECKING, Any, Union, overload
|
Code cleanup
Remove no longer used google scripts
Remove convenience files from comicataggerlib and import comicapi directly
Add type-hints to facilitate auto-complete tools
Make PyQt5 code more compatible with PyQt6
Implement automatic tooling
isort and black for code formatting
Line length has been set to 120
flake8 for code standards with exceptions:
E203 - Whitespace before ':' - format compatiblity with black
E501 - Line too long - flake8 line limit cannot be set
E722 - Do not use bare except - fixing bare except statements is a
lot of overhead and there are already
many in the codebase
These changes, along with some manual fixes creates much more readable code.
See examples below:
diff --git a/comicapi/comet.py b/comicapi/comet.py
index d1741c5..52dc195 100644
--- a/comicapi/comet.py
+++ b/comicapi/comet.py
@@ -166,7 +166,2 @@ class CoMet:
- if credit['role'].lower() in set(self.editor_synonyms):
- ET.SubElement(
- root,
- 'editor').text = "{0}".format(
- credit['person'])
@@ -174,2 +169,4 @@ class CoMet:
self.indent(root)
+ if credit["role"].lower() in set(self.editor_synonyms):
+ ET.SubElement(root, "editor").text = str(credit["person"])
diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py
index 4338176..9219f01 100644
--- a/comictaggerlib/autotagmatchwindow.py
+++ b/comictaggerlib/autotagmatchwindow.py
@@ -63,4 +63,3 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
self.skipButton, QtWidgets.QDialogButtonBox.ActionRole)
- self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(
- "Accept and Write Tags")
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText("Accept and Write Tags")
diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py
index 688907d..dbd0c2e 100644
--- a/comictaggerlib/cli.py
+++ b/comictaggerlib/cli.py
@@ -293,7 +293,3 @@ def process_file_cli(filename, opts, settings, match_results):
if opts.raw:
- print((
- "{0}".format(
- str(
- ca.readRawCIX(),
- errors='ignore'))))
+ print(ca.read_raw_cix())
else:
2022-04-01 16:50:46 -07:00
|
|
|
|
2024-07-19 16:18:57 -07:00
|
|
|
from typing_extensions import NamedTuple
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
|
2024-05-10 15:51:13 -07:00
|
|
|
from comicapi import merge, utils
|
2024-04-05 10:32:40 -07:00
|
|
|
from comicapi._url import Url, parse_url
|
2024-02-04 12:33:10 -08:00
|
|
|
from comicapi.utils import norm_fold
|
2015-02-16 04:27:21 -08:00
|
|
|
|
2024-07-27 19:26:09 -07:00
|
|
|
# needed for runtime type guessing
|
2024-04-05 10:32:40 -07:00
|
|
|
if TYPE_CHECKING:
|
|
|
|
Union
|
2024-02-17 15:08:36 -08:00
|
|
|
|
2022-04-04 18:59:26 -07:00
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
2015-02-21 18:30:32 -08:00
|
|
|
|
2024-05-10 15:51:13 -07:00
|
|
|
REMOVE = object()
|
2024-02-04 12:33:10 -08:00
|
|
|
|
|
|
|
|
2024-07-19 16:18:57 -07:00
|
|
|
class PageType(merge.StrEnum):
|
2015-02-21 18:30:32 -08:00
|
|
|
"""
|
|
|
|
These page info classes are exactly the same as the CIX scheme, since
|
|
|
|
it's unique
|
|
|
|
"""
|
|
|
|
|
|
|
|
FrontCover = "FrontCover"
|
|
|
|
InnerCover = "InnerCover"
|
|
|
|
Roundup = "Roundup"
|
|
|
|
Story = "Story"
|
|
|
|
Advertisement = "Advertisement"
|
|
|
|
Editorial = "Editorial"
|
|
|
|
Letters = "Letters"
|
|
|
|
Preview = "Preview"
|
|
|
|
BackCover = "BackCover"
|
|
|
|
Other = "Other"
|
|
|
|
Deleted = "Deleted"
|
2015-02-16 04:27:21 -08:00
|
|
|
|
Code cleanup
Remove no longer used google scripts
Remove convenience files from comicataggerlib and import comicapi directly
Add type-hints to facilitate auto-complete tools
Make PyQt5 code more compatible with PyQt6
Implement automatic tooling
isort and black for code formatting
Line length has been set to 120
flake8 for code standards with exceptions:
E203 - Whitespace before ':' - format compatiblity with black
E501 - Line too long - flake8 line limit cannot be set
E722 - Do not use bare except - fixing bare except statements is a
lot of overhead and there are already
many in the codebase
These changes, along with some manual fixes creates much more readable code.
See examples below:
diff --git a/comicapi/comet.py b/comicapi/comet.py
index d1741c5..52dc195 100644
--- a/comicapi/comet.py
+++ b/comicapi/comet.py
@@ -166,7 +166,2 @@ class CoMet:
- if credit['role'].lower() in set(self.editor_synonyms):
- ET.SubElement(
- root,
- 'editor').text = "{0}".format(
- credit['person'])
@@ -174,2 +169,4 @@ class CoMet:
self.indent(root)
+ if credit["role"].lower() in set(self.editor_synonyms):
+ ET.SubElement(root, "editor").text = str(credit["person"])
diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py
index 4338176..9219f01 100644
--- a/comictaggerlib/autotagmatchwindow.py
+++ b/comictaggerlib/autotagmatchwindow.py
@@ -63,4 +63,3 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
self.skipButton, QtWidgets.QDialogButtonBox.ActionRole)
- self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(
- "Accept and Write Tags")
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText("Accept and Write Tags")
diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py
index 688907d..dbd0c2e 100644
--- a/comictaggerlib/cli.py
+++ b/comictaggerlib/cli.py
@@ -293,7 +293,3 @@ def process_file_cli(filename, opts, settings, match_results):
if opts.raw:
- print((
- "{0}".format(
- str(
- ca.readRawCIX(),
- errors='ignore'))))
+ print(ca.read_raw_cix())
else:
2022-04-01 16:50:46 -07:00
|
|
|
|
2024-07-19 16:18:57 -07:00
|
|
|
@dataclasses.dataclass
|
|
|
|
class PageMetadata:
|
2023-12-18 02:37:34 -08:00
|
|
|
filename: str
|
2023-12-17 21:47:43 -08:00
|
|
|
type: str
|
|
|
|
bookmark: str
|
2024-07-19 16:18:57 -07:00
|
|
|
display_index: int
|
|
|
|
archive_index: int
|
|
|
|
# These are optional because getting this info requires reading in each page
|
|
|
|
double_page: bool | None = None
|
|
|
|
byte_size: int | None = None
|
|
|
|
height: int | None = None
|
|
|
|
width: int | None = None
|
|
|
|
|
|
|
|
def set_type(self, value: str) -> None:
|
|
|
|
values = {x.casefold(): x for x in PageType}
|
|
|
|
self.type = values.get(value.casefold(), value)
|
|
|
|
|
|
|
|
def is_double_page(self) -> bool:
|
|
|
|
w = self.width or 0
|
|
|
|
h = self.height or 0
|
|
|
|
return self.double_page or (w >= h and w > 0 and h > 0)
|
|
|
|
|
|
|
|
def __lt__(self, other: Any) -> bool:
|
|
|
|
if not isinstance(other, PageMetadata):
|
|
|
|
return False
|
|
|
|
return self.archive_index < other.archive_index
|
|
|
|
|
|
|
|
def __eq__(self, other: Any) -> bool:
|
|
|
|
if not isinstance(other, PageMetadata):
|
|
|
|
return False
|
|
|
|
return self.archive_index == other.archive_index
|
Code cleanup
Remove no longer used google scripts
Remove convenience files from comicataggerlib and import comicapi directly
Add type-hints to facilitate auto-complete tools
Make PyQt5 code more compatible with PyQt6
Implement automatic tooling
isort and black for code formatting
Line length has been set to 120
flake8 for code standards with exceptions:
E203 - Whitespace before ':' - format compatiblity with black
E501 - Line too long - flake8 line limit cannot be set
E722 - Do not use bare except - fixing bare except statements is a
lot of overhead and there are already
many in the codebase
These changes, along with some manual fixes creates much more readable code.
See examples below:
diff --git a/comicapi/comet.py b/comicapi/comet.py
index d1741c5..52dc195 100644
--- a/comicapi/comet.py
+++ b/comicapi/comet.py
@@ -166,7 +166,2 @@ class CoMet:
- if credit['role'].lower() in set(self.editor_synonyms):
- ET.SubElement(
- root,
- 'editor').text = "{0}".format(
- credit['person'])
@@ -174,2 +169,4 @@ class CoMet:
self.indent(root)
+ if credit["role"].lower() in set(self.editor_synonyms):
+ ET.SubElement(root, "editor").text = str(credit["person"])
diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py
index 4338176..9219f01 100644
--- a/comictaggerlib/autotagmatchwindow.py
+++ b/comictaggerlib/autotagmatchwindow.py
@@ -63,4 +63,3 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
self.skipButton, QtWidgets.QDialogButtonBox.ActionRole)
- self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(
- "Accept and Write Tags")
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText("Accept and Write Tags")
diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py
index 688907d..dbd0c2e 100644
--- a/comictaggerlib/cli.py
+++ b/comictaggerlib/cli.py
@@ -293,7 +293,3 @@ def process_file_cli(filename, opts, settings, match_results):
if opts.raw:
- print((
- "{0}".format(
- str(
- ca.readRawCIX(),
- errors='ignore'))))
+ print(ca.read_raw_cix())
else:
2022-04-01 16:50:46 -07:00
|
|
|
|
|
|
|
|
2024-05-10 15:51:13 -07:00
|
|
|
Credit = merge.Credit
|
2015-02-21 18:30:32 -08:00
|
|
|
|
2015-02-16 04:27:21 -08:00
|
|
|
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
@dataclasses.dataclass
|
|
|
|
class ComicSeries:
|
|
|
|
id: str
|
|
|
|
name: str
|
2023-09-24 06:33:57 -07:00
|
|
|
aliases: set[str]
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
count_of_issues: int | None
|
|
|
|
count_of_volumes: int | None
|
|
|
|
description: str
|
|
|
|
image_url: str
|
|
|
|
publisher: str
|
|
|
|
start_year: int | None
|
|
|
|
format: str | None
|
|
|
|
|
|
|
|
def copy(self) -> ComicSeries:
|
|
|
|
return copy.deepcopy(self)
|
|
|
|
|
|
|
|
|
2024-06-20 16:47:10 -07:00
|
|
|
class MetadataOrigin(NamedTuple):
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
id: str
|
|
|
|
name: str
|
|
|
|
|
2024-06-21 20:07:07 -07:00
|
|
|
def __str__(self) -> str:
|
|
|
|
return self.name
|
|
|
|
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
|
2022-07-18 09:00:56 -07:00
|
|
|
@dataclasses.dataclass
|
2015-02-16 04:27:21 -08:00
|
|
|
class GenericMetadata:
|
2024-01-21 15:00:28 -08:00
|
|
|
writer_synonyms = ("writer", "plotter", "scripter", "script")
|
|
|
|
penciller_synonyms = ("artist", "penciller", "penciler", "breakdowns", "pencils", "painting")
|
|
|
|
inker_synonyms = ("inker", "artist", "finishes", "inks", "painting")
|
|
|
|
colorist_synonyms = ("colorist", "colourist", "colorer", "colourer", "colors", "painting")
|
|
|
|
letterer_synonyms = ("letterer", "letters")
|
|
|
|
cover_synonyms = ("cover", "covers", "coverartist", "cover artist")
|
|
|
|
editor_synonyms = ("editor", "edits", "editing")
|
2024-02-18 21:39:27 -08:00
|
|
|
translator_synonyms = ("translator", "translation")
|
2015-02-16 04:27:21 -08:00
|
|
|
|
2022-07-01 16:12:29 -07:00
|
|
|
is_empty: bool = True
|
2024-06-20 16:47:10 -07:00
|
|
|
data_origin: MetadataOrigin | None = None
|
2022-12-23 00:09:19 -08:00
|
|
|
issue_id: str | None = None
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
series_id: str | None = None
|
2022-07-01 16:12:29 -07:00
|
|
|
|
|
|
|
series: str | None = None
|
2023-09-24 06:33:57 -07:00
|
|
|
series_aliases: set[str] = dataclasses.field(default_factory=set)
|
2022-07-01 16:12:29 -07:00
|
|
|
issue: str | None = None
|
2023-12-17 15:51:43 -08:00
|
|
|
issue_count: int | None = None
|
2022-07-01 16:12:29 -07:00
|
|
|
title: str | None = None
|
2023-09-24 06:33:57 -07:00
|
|
|
title_aliases: set[str] = dataclasses.field(default_factory=set)
|
2022-07-01 16:12:29 -07:00
|
|
|
volume: int | None = None
|
2023-12-17 15:51:43 -08:00
|
|
|
volume_count: int | None = None
|
2023-09-24 06:33:57 -07:00
|
|
|
genres: set[str] = dataclasses.field(default_factory=set)
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
description: str | None = None # use same way as Summary in CIX
|
2023-12-17 15:51:43 -08:00
|
|
|
notes: str | None = None
|
2022-07-01 16:12:29 -07:00
|
|
|
|
|
|
|
alternate_series: str | None = None
|
|
|
|
alternate_number: str | None = None
|
|
|
|
alternate_count: int | None = None
|
2023-12-17 15:51:43 -08:00
|
|
|
story_arcs: list[str] = dataclasses.field(default_factory=list)
|
|
|
|
series_groups: list[str] = dataclasses.field(default_factory=list)
|
|
|
|
|
|
|
|
publisher: str | None = None
|
2022-07-01 16:12:29 -07:00
|
|
|
imprint: str | None = None
|
2023-12-17 15:51:43 -08:00
|
|
|
day: int | None = None
|
|
|
|
month: int | None = None
|
|
|
|
year: int | None = None
|
|
|
|
language: str | None = None # 2 letter iso code
|
|
|
|
country: str | None = None
|
2024-02-17 15:08:36 -08:00
|
|
|
web_links: list[Url] = dataclasses.field(default_factory=list)
|
2022-07-01 16:12:29 -07:00
|
|
|
format: str | None = None
|
|
|
|
manga: str | None = None
|
|
|
|
black_and_white: bool | None = None
|
|
|
|
maturity_rating: str | None = None
|
2023-12-17 15:51:43 -08:00
|
|
|
critical_rating: float | None = None # rating in CBL; CommunityRating in CIX
|
2022-07-01 16:12:29 -07:00
|
|
|
scan_info: str | None = None
|
|
|
|
|
2023-12-17 15:51:43 -08:00
|
|
|
tags: set[str] = dataclasses.field(default_factory=set)
|
2024-07-19 16:18:57 -07:00
|
|
|
pages: list[PageMetadata] = dataclasses.field(default_factory=list)
|
2023-12-17 15:51:43 -08:00
|
|
|
page_count: int | None = None
|
|
|
|
|
2023-09-24 06:33:57 -07:00
|
|
|
characters: set[str] = dataclasses.field(default_factory=set)
|
|
|
|
teams: set[str] = dataclasses.field(default_factory=set)
|
|
|
|
locations: set[str] = dataclasses.field(default_factory=set)
|
2024-07-19 16:18:57 -07:00
|
|
|
credits: list[merge.Credit] = dataclasses.field(default_factory=list)
|
2022-07-01 16:12:29 -07:00
|
|
|
|
|
|
|
# Some CoMet-only items
|
2023-04-25 00:55:23 -07:00
|
|
|
price: float | None = None
|
2022-07-01 16:12:29 -07:00
|
|
|
is_version_of: str | None = None
|
|
|
|
rights: str | None = None
|
|
|
|
identifier: str | None = None
|
|
|
|
last_mark: str | None = None
|
2023-12-17 15:51:43 -08:00
|
|
|
|
|
|
|
# urls to cover image, not generally part of the metadata
|
|
|
|
_cover_image: str | None = None
|
|
|
|
_alternate_images: list[str] = dataclasses.field(default_factory=list)
|
2022-07-01 16:12:29 -07:00
|
|
|
|
2022-11-22 16:51:26 -08:00
|
|
|
def __post_init__(self) -> None:
|
2022-07-01 16:12:29 -07:00
|
|
|
for key, value in self.__dict__.items():
|
|
|
|
if value and key != "is_empty":
|
|
|
|
self.is_empty = False
|
|
|
|
break
|
2022-06-02 18:32:16 -07:00
|
|
|
|
2022-07-18 09:00:56 -07:00
|
|
|
def copy(self) -> GenericMetadata:
|
|
|
|
return copy.deepcopy(self)
|
|
|
|
|
2022-07-18 12:17:13 -07:00
|
|
|
def replace(self, /, **kwargs: Any) -> GenericMetadata:
|
2022-07-18 09:00:56 -07:00
|
|
|
tmp = self.copy()
|
|
|
|
tmp.__dict__.update(kwargs)
|
|
|
|
return tmp
|
|
|
|
|
2023-12-17 21:47:43 -08:00
|
|
|
def get_clean_metadata(self, *attributes: str) -> GenericMetadata:
|
|
|
|
new_md = GenericMetadata()
|
|
|
|
for attr in sorted(attributes):
|
|
|
|
if "." in attr:
|
|
|
|
lst, _, name = attr.partition(".")
|
|
|
|
old_value = getattr(self, lst)
|
|
|
|
new_value = getattr(new_md, lst)
|
|
|
|
if old_value:
|
|
|
|
if not new_value:
|
|
|
|
for x in old_value:
|
|
|
|
new_value.append(x.__class__())
|
|
|
|
for i, x in enumerate(old_value):
|
|
|
|
if isinstance(x, dict):
|
|
|
|
if name in x:
|
|
|
|
new_value[i][name] = x[name]
|
|
|
|
else:
|
|
|
|
setattr(new_value[i], name, getattr(x, name))
|
|
|
|
|
|
|
|
else:
|
|
|
|
old_value = getattr(self, attr)
|
|
|
|
if isinstance(old_value, list):
|
|
|
|
continue
|
|
|
|
setattr(new_md, attr, old_value)
|
|
|
|
|
|
|
|
new_md.__post_init__()
|
|
|
|
return new_md
|
|
|
|
|
2024-05-11 08:42:24 -07:00
|
|
|
def overlay(
|
|
|
|
self, new_md: GenericMetadata, mode: merge.Mode = merge.Mode.OVERLAY, merge_lists: bool = False
|
|
|
|
) -> None:
|
2024-02-04 12:33:10 -08:00
|
|
|
"""Overlay a new metadata object on this one"""
|
|
|
|
|
2024-05-11 08:42:24 -07:00
|
|
|
attribute_merge = merge.attribute[mode]
|
|
|
|
list_merge = merge.lists[mode]
|
2024-02-04 12:33:10 -08:00
|
|
|
|
2024-05-11 08:42:24 -07:00
|
|
|
def assign(old: Any, new: Any, attribute_merge: Any = attribute_merge) -> Any:
|
2024-02-04 12:33:10 -08:00
|
|
|
if new is REMOVE:
|
2024-05-10 15:51:13 -07:00
|
|
|
return None
|
2024-02-04 12:33:10 -08:00
|
|
|
|
2024-05-11 08:42:24 -07:00
|
|
|
return attribute_merge(old, new)
|
|
|
|
|
|
|
|
def assign_list(old: list[Any] | set[Any], new: list[Any] | set[Any], list_merge: Any = list_merge) -> Any:
|
|
|
|
if new is REMOVE:
|
|
|
|
old.clear()
|
|
|
|
return old
|
|
|
|
if merge_lists:
|
|
|
|
return list_merge(old, new)
|
|
|
|
else:
|
|
|
|
return assign(old, new)
|
2015-02-21 18:30:32 -08:00
|
|
|
|
Code cleanup
Remove no longer used google scripts
Remove convenience files from comicataggerlib and import comicapi directly
Add type-hints to facilitate auto-complete tools
Make PyQt5 code more compatible with PyQt6
Implement automatic tooling
isort and black for code formatting
Line length has been set to 120
flake8 for code standards with exceptions:
E203 - Whitespace before ':' - format compatiblity with black
E501 - Line too long - flake8 line limit cannot be set
E722 - Do not use bare except - fixing bare except statements is a
lot of overhead and there are already
many in the codebase
These changes, along with some manual fixes creates much more readable code.
See examples below:
diff --git a/comicapi/comet.py b/comicapi/comet.py
index d1741c5..52dc195 100644
--- a/comicapi/comet.py
+++ b/comicapi/comet.py
@@ -166,7 +166,2 @@ class CoMet:
- if credit['role'].lower() in set(self.editor_synonyms):
- ET.SubElement(
- root,
- 'editor').text = "{0}".format(
- credit['person'])
@@ -174,2 +169,4 @@ class CoMet:
self.indent(root)
+ if credit["role"].lower() in set(self.editor_synonyms):
+ ET.SubElement(root, "editor").text = str(credit["person"])
diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py
index 4338176..9219f01 100644
--- a/comictaggerlib/autotagmatchwindow.py
+++ b/comictaggerlib/autotagmatchwindow.py
@@ -63,4 +63,3 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
self.skipButton, QtWidgets.QDialogButtonBox.ActionRole)
- self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(
- "Accept and Write Tags")
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText("Accept and Write Tags")
diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py
index 688907d..dbd0c2e 100644
--- a/comictaggerlib/cli.py
+++ b/comictaggerlib/cli.py
@@ -293,7 +293,3 @@ def process_file_cli(filename, opts, settings, match_results):
if opts.raw:
- print((
- "{0}".format(
- str(
- ca.readRawCIX(),
- errors='ignore'))))
+ print(ca.read_raw_cix())
else:
2022-04-01 16:50:46 -07:00
|
|
|
if not new_md.is_empty:
|
|
|
|
self.is_empty = False
|
2015-02-21 18:30:32 -08:00
|
|
|
|
2024-06-20 16:47:10 -07:00
|
|
|
self.data_origin = assign(self.data_origin, new_md.data_origin) # TODO use and purpose now?
|
2024-02-04 12:33:10 -08:00
|
|
|
self.issue_id = assign(self.issue_id, new_md.issue_id)
|
|
|
|
self.series_id = assign(self.series_id, new_md.series_id)
|
|
|
|
|
|
|
|
self.series = assign(self.series, new_md.series)
|
2024-05-11 08:42:24 -07:00
|
|
|
|
|
|
|
self.series_aliases = assign_list(self.series_aliases, new_md.series_aliases)
|
2024-02-04 12:33:10 -08:00
|
|
|
self.issue = assign(self.issue, new_md.issue)
|
|
|
|
self.issue_count = assign(self.issue_count, new_md.issue_count)
|
|
|
|
self.title = assign(self.title, new_md.title)
|
2024-05-11 08:42:24 -07:00
|
|
|
self.title_aliases = assign_list(self.title_aliases, new_md.title_aliases)
|
2024-02-04 12:33:10 -08:00
|
|
|
self.volume = assign(self.volume, new_md.volume)
|
|
|
|
self.volume_count = assign(self.volume_count, new_md.volume_count)
|
2024-05-11 08:42:24 -07:00
|
|
|
self.genres = assign_list(self.genres, new_md.genres)
|
2024-02-04 12:33:10 -08:00
|
|
|
self.description = assign(self.description, new_md.description)
|
|
|
|
self.notes = assign(self.notes, new_md.notes)
|
|
|
|
|
|
|
|
self.alternate_series = assign(self.alternate_series, new_md.alternate_series)
|
|
|
|
self.alternate_number = assign(self.alternate_number, new_md.alternate_number)
|
|
|
|
self.alternate_count = assign(self.alternate_count, new_md.alternate_count)
|
2024-05-11 08:42:24 -07:00
|
|
|
self.story_arcs = assign_list(self.story_arcs, new_md.story_arcs)
|
|
|
|
self.series_groups = assign_list(self.series_groups, new_md.series_groups)
|
2024-02-04 12:33:10 -08:00
|
|
|
|
|
|
|
self.publisher = assign(self.publisher, new_md.publisher)
|
|
|
|
self.imprint = assign(self.imprint, new_md.imprint)
|
|
|
|
self.day = assign(self.day, new_md.day)
|
|
|
|
self.month = assign(self.month, new_md.month)
|
|
|
|
self.year = assign(self.year, new_md.year)
|
|
|
|
self.language = assign(self.language, new_md.language)
|
|
|
|
self.country = assign(self.country, new_md.country)
|
2024-05-11 08:42:24 -07:00
|
|
|
self.web_links = assign_list(self.web_links, new_md.web_links)
|
2024-02-04 12:33:10 -08:00
|
|
|
self.format = assign(self.format, new_md.format)
|
|
|
|
self.manga = assign(self.manga, new_md.manga)
|
|
|
|
self.black_and_white = assign(self.black_and_white, new_md.black_and_white)
|
|
|
|
self.maturity_rating = assign(self.maturity_rating, new_md.maturity_rating)
|
|
|
|
self.critical_rating = assign(self.critical_rating, new_md.critical_rating)
|
|
|
|
self.scan_info = assign(self.scan_info, new_md.scan_info)
|
|
|
|
|
2024-05-11 08:42:24 -07:00
|
|
|
self.tags = assign_list(self.tags, new_md.tags)
|
2024-02-04 12:33:10 -08:00
|
|
|
|
2024-05-11 08:42:24 -07:00
|
|
|
self.characters = assign_list(self.characters, new_md.characters)
|
|
|
|
self.teams = assign_list(self.teams, new_md.teams)
|
|
|
|
self.locations = assign_list(self.locations, new_md.locations)
|
2024-07-27 15:45:03 -07:00
|
|
|
|
|
|
|
# credits are added through add_credit so that some standard checks are observed
|
|
|
|
# which means that we needs self.credits to be empty
|
|
|
|
tmp_credits = self.credits
|
|
|
|
self.credits = []
|
|
|
|
for c in assign_list(tmp_credits, new_md.credits):
|
|
|
|
self.add_credit(c)
|
2024-02-04 12:33:10 -08:00
|
|
|
|
|
|
|
self.price = assign(self.price, new_md.price)
|
|
|
|
self.is_version_of = assign(self.is_version_of, new_md.is_version_of)
|
|
|
|
self.rights = assign(self.rights, new_md.rights)
|
|
|
|
self.identifier = assign(self.identifier, new_md.identifier)
|
|
|
|
self.last_mark = assign(self.last_mark, new_md.last_mark)
|
|
|
|
self._cover_image = assign(self._cover_image, new_md._cover_image)
|
2024-05-11 08:42:24 -07:00
|
|
|
self._alternate_images = assign_list(self._alternate_images, new_md._alternate_images)
|
2024-02-04 12:33:10 -08:00
|
|
|
|
2024-07-27 15:45:03 -07:00
|
|
|
# pages doesn't get merged, if we did merge we would end up with duplicate pages
|
|
|
|
self.pages = assign(self.pages, new_md.pages)
|
2024-05-10 15:51:13 -07:00
|
|
|
self.page_count = assign(self.page_count, new_md.page_count)
|
2015-02-21 18:30:32 -08:00
|
|
|
|
2023-12-18 02:37:34 -08:00
|
|
|
def apply_default_page_list(self, page_list: Sequence[str]) -> None:
|
2024-07-19 16:18:57 -07:00
|
|
|
"""apply a default page list, with the first page marked as the cover"""
|
2023-12-20 21:24:12 -08:00
|
|
|
|
2024-07-19 16:18:57 -07:00
|
|
|
# Create a dictionary in the weird case that the metadata doesn't match the archive
|
|
|
|
pages = {p.archive_index: p for p in self.pages}
|
2023-12-18 02:37:34 -08:00
|
|
|
cover_set = False
|
2024-07-19 16:18:57 -07:00
|
|
|
|
|
|
|
# It might be a good idea to validate that each page in `pages` is found in page_list
|
2023-12-18 02:37:34 -08:00
|
|
|
for i, filename in enumerate(page_list):
|
2024-07-19 16:18:57 -07:00
|
|
|
page = pages.get(i, PageMetadata(archive_index=i, display_index=i, filename="", type="", bookmark=""))
|
|
|
|
page.filename = filename
|
|
|
|
pages[i] = page
|
2023-12-18 02:37:34 -08:00
|
|
|
|
|
|
|
# Check if we know what the cover is
|
2024-07-19 16:18:57 -07:00
|
|
|
cover_set = page.type == PageType.FrontCover or cover_set
|
|
|
|
self.pages = sorted(pages.values())
|
2023-12-18 02:37:34 -08:00
|
|
|
|
2024-07-19 16:18:57 -07:00
|
|
|
self.page_count = len(self.pages)
|
|
|
|
if self.page_count != len(page_list):
|
|
|
|
logger.warning("Wrong count of pages: expected %d got %d", len(self.pages), len(page_list))
|
|
|
|
# Set the cover to the first image acording to hte display index if we don't know what the cover is
|
2023-12-18 02:37:34 -08:00
|
|
|
if not cover_set:
|
2024-07-19 16:18:57 -07:00
|
|
|
first_page = self.get_archive_page_index(0)
|
|
|
|
self.pages[first_page].type = PageType.FrontCover
|
2015-02-21 18:30:32 -08:00
|
|
|
|
2022-05-17 13:57:04 -07:00
|
|
|
def get_archive_page_index(self, pagenum: int) -> int:
|
2024-07-19 16:18:57 -07:00
|
|
|
"""convert the displayed page number to the page index of the file in the archive"""
|
2015-02-21 18:30:32 -08:00
|
|
|
if pagenum < len(self.pages):
|
2024-07-19 16:18:57 -07:00
|
|
|
return int(sorted(self.pages, key=lambda p: p.display_index)[pagenum].archive_index)
|
Code cleanup
Remove no longer used google scripts
Remove convenience files from comicataggerlib and import comicapi directly
Add type-hints to facilitate auto-complete tools
Make PyQt5 code more compatible with PyQt6
Implement automatic tooling
isort and black for code formatting
Line length has been set to 120
flake8 for code standards with exceptions:
E203 - Whitespace before ':' - format compatiblity with black
E501 - Line too long - flake8 line limit cannot be set
E722 - Do not use bare except - fixing bare except statements is a
lot of overhead and there are already
many in the codebase
These changes, along with some manual fixes creates much more readable code.
See examples below:
diff --git a/comicapi/comet.py b/comicapi/comet.py
index d1741c5..52dc195 100644
--- a/comicapi/comet.py
+++ b/comicapi/comet.py
@@ -166,7 +166,2 @@ class CoMet:
- if credit['role'].lower() in set(self.editor_synonyms):
- ET.SubElement(
- root,
- 'editor').text = "{0}".format(
- credit['person'])
@@ -174,2 +169,4 @@ class CoMet:
self.indent(root)
+ if credit["role"].lower() in set(self.editor_synonyms):
+ ET.SubElement(root, "editor").text = str(credit["person"])
diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py
index 4338176..9219f01 100644
--- a/comictaggerlib/autotagmatchwindow.py
+++ b/comictaggerlib/autotagmatchwindow.py
@@ -63,4 +63,3 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
self.skipButton, QtWidgets.QDialogButtonBox.ActionRole)
- self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(
- "Accept and Write Tags")
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText("Accept and Write Tags")
diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py
index 688907d..dbd0c2e 100644
--- a/comictaggerlib/cli.py
+++ b/comictaggerlib/cli.py
@@ -293,7 +293,3 @@ def process_file_cli(filename, opts, settings, match_results):
if opts.raw:
- print((
- "{0}".format(
- str(
- ca.readRawCIX(),
- errors='ignore'))))
+ print(ca.read_raw_cix())
else:
2022-04-01 16:50:46 -07:00
|
|
|
|
|
|
|
return 0
|
2015-02-21 18:30:32 -08:00
|
|
|
|
2022-05-17 13:57:04 -07:00
|
|
|
def get_cover_page_index_list(self) -> list[int]:
|
2015-02-21 18:30:32 -08:00
|
|
|
# return a list of archive page indices of cover pages
|
2024-06-09 13:40:42 -07:00
|
|
|
if not self.pages:
|
|
|
|
return [0]
|
2015-02-21 18:30:32 -08:00
|
|
|
coverlist = []
|
|
|
|
for p in self.pages:
|
2024-07-19 16:18:57 -07:00
|
|
|
if p.type == PageType.FrontCover:
|
|
|
|
coverlist.append(p.archive_index)
|
2015-02-21 18:30:32 -08:00
|
|
|
|
|
|
|
if len(coverlist) == 0:
|
2024-07-19 16:18:57 -07:00
|
|
|
coverlist.append(self.get_archive_page_index(0))
|
2015-02-21 18:30:32 -08:00
|
|
|
|
|
|
|
return coverlist
|
|
|
|
|
2024-05-10 15:51:13 -07:00
|
|
|
@overload
|
2024-07-19 16:18:57 -07:00
|
|
|
def add_credit(self, person: merge.Credit) -> None: ...
|
2024-05-10 15:51:13 -07:00
|
|
|
|
|
|
|
@overload
|
|
|
|
def add_credit(self, person: str, role: str, primary: bool = False) -> None: ...
|
|
|
|
|
2024-07-19 16:18:57 -07:00
|
|
|
def add_credit(self, person: str | merge.Credit, role: str | None = None, primary: bool = False) -> None:
|
2024-02-04 12:33:10 -08:00
|
|
|
|
2024-07-19 16:18:57 -07:00
|
|
|
credit: merge.Credit
|
|
|
|
if isinstance(person, merge.Credit):
|
2024-05-10 15:51:13 -07:00
|
|
|
credit = person
|
|
|
|
else:
|
|
|
|
assert role is not None
|
2024-07-19 16:18:57 -07:00
|
|
|
credit = merge.Credit(person=person, role=role, primary=primary)
|
2024-05-10 15:51:13 -07:00
|
|
|
|
|
|
|
if credit.role is None:
|
|
|
|
raise TypeError("GenericMetadata.add_credit takes either a Credit object or a person name and role")
|
|
|
|
if credit.person == "":
|
|
|
|
return
|
2015-02-21 18:30:32 -08:00
|
|
|
|
2024-05-10 15:51:13 -07:00
|
|
|
person = norm_fold(credit.person)
|
|
|
|
role = norm_fold(credit.role)
|
2024-04-22 17:16:44 -07:00
|
|
|
|
2015-02-21 18:30:32 -08:00
|
|
|
# look to see if it's not already there...
|
|
|
|
found = False
|
|
|
|
for c in self.credits:
|
2024-05-10 15:51:13 -07:00
|
|
|
if norm_fold(c.person) == person and norm_fold(c.role) == role:
|
2015-02-21 18:30:32 -08:00
|
|
|
# no need to add it. just adjust the "primary" flag as needed
|
2024-05-10 15:51:13 -07:00
|
|
|
c.primary = c.primary or primary
|
2015-02-21 18:30:32 -08:00
|
|
|
found = True
|
|
|
|
break
|
|
|
|
|
|
|
|
if not found:
|
|
|
|
self.credits.append(credit)
|
|
|
|
|
2022-05-17 13:57:04 -07:00
|
|
|
def get_primary_credit(self, role: str) -> str:
|
2022-04-18 18:59:17 -07:00
|
|
|
primary = ""
|
|
|
|
for credit in self.credits:
|
2024-05-10 15:51:13 -07:00
|
|
|
if (primary == "" and credit.role.casefold() == role.casefold()) or (
|
|
|
|
credit.role.casefold() == role.casefold() and credit.primary
|
2022-04-18 18:59:17 -07:00
|
|
|
):
|
2024-05-10 15:51:13 -07:00
|
|
|
primary = credit.person
|
2022-04-18 18:59:17 -07:00
|
|
|
return primary
|
|
|
|
|
2022-05-17 13:57:04 -07:00
|
|
|
def __str__(self) -> str:
|
|
|
|
vals: list[tuple[str, Any]] = []
|
Code cleanup
Remove no longer used google scripts
Remove convenience files from comicataggerlib and import comicapi directly
Add type-hints to facilitate auto-complete tools
Make PyQt5 code more compatible with PyQt6
Implement automatic tooling
isort and black for code formatting
Line length has been set to 120
flake8 for code standards with exceptions:
E203 - Whitespace before ':' - format compatiblity with black
E501 - Line too long - flake8 line limit cannot be set
E722 - Do not use bare except - fixing bare except statements is a
lot of overhead and there are already
many in the codebase
These changes, along with some manual fixes creates much more readable code.
See examples below:
diff --git a/comicapi/comet.py b/comicapi/comet.py
index d1741c5..52dc195 100644
--- a/comicapi/comet.py
+++ b/comicapi/comet.py
@@ -166,7 +166,2 @@ class CoMet:
- if credit['role'].lower() in set(self.editor_synonyms):
- ET.SubElement(
- root,
- 'editor').text = "{0}".format(
- credit['person'])
@@ -174,2 +169,4 @@ class CoMet:
self.indent(root)
+ if credit["role"].lower() in set(self.editor_synonyms):
+ ET.SubElement(root, "editor").text = str(credit["person"])
diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py
index 4338176..9219f01 100644
--- a/comictaggerlib/autotagmatchwindow.py
+++ b/comictaggerlib/autotagmatchwindow.py
@@ -63,4 +63,3 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
self.skipButton, QtWidgets.QDialogButtonBox.ActionRole)
- self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(
- "Accept and Write Tags")
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText("Accept and Write Tags")
diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py
index 688907d..dbd0c2e 100644
--- a/comictaggerlib/cli.py
+++ b/comictaggerlib/cli.py
@@ -293,7 +293,3 @@ def process_file_cli(filename, opts, settings, match_results):
if opts.raw:
- print((
- "{0}".format(
- str(
- ca.readRawCIX(),
- errors='ignore'))))
+ print(ca.read_raw_cix())
else:
2022-04-01 16:50:46 -07:00
|
|
|
if self.is_empty:
|
2015-02-21 18:30:32 -08:00
|
|
|
return "No metadata"
|
|
|
|
|
2022-05-17 13:57:04 -07:00
|
|
|
def add_string(tag: str, val: Any) -> None:
|
2024-06-22 20:19:02 -07:00
|
|
|
if isinstance(val, (Sequence, set)):
|
2023-11-05 21:36:29 -08:00
|
|
|
if val:
|
|
|
|
vals.append((tag, val))
|
|
|
|
elif val is not None:
|
2015-02-21 18:30:32 -08:00
|
|
|
vals.append((tag, val))
|
|
|
|
|
2024-06-22 20:19:02 -07:00
|
|
|
add_string("data_origin", self.data_origin)
|
2024-04-06 12:00:17 -07:00
|
|
|
add_string("series", self.series)
|
2024-06-22 20:19:02 -07:00
|
|
|
add_string("series_aliases", ",".join(self.series_aliases))
|
2024-04-06 12:00:17 -07:00
|
|
|
add_string("issue", self.issue)
|
|
|
|
add_string("issue_count", self.issue_count)
|
|
|
|
add_string("title", self.title)
|
2024-06-22 20:19:02 -07:00
|
|
|
add_string("title_aliases", ",".join(self.title_aliases))
|
2024-04-06 12:00:17 -07:00
|
|
|
add_string("publisher", self.publisher)
|
|
|
|
add_string("year", self.year)
|
|
|
|
add_string("month", self.month)
|
|
|
|
add_string("day", self.day)
|
|
|
|
add_string("volume", self.volume)
|
|
|
|
add_string("volume_count", self.volume_count)
|
2023-09-24 06:33:57 -07:00
|
|
|
add_string("genres", ", ".join(self.genres))
|
2024-04-06 12:00:17 -07:00
|
|
|
add_string("language", self.language)
|
|
|
|
add_string("country", self.country)
|
|
|
|
add_string("critical_rating", self.critical_rating)
|
|
|
|
add_string("alternate_series", self.alternate_series)
|
|
|
|
add_string("alternate_number", self.alternate_number)
|
|
|
|
add_string("alternate_count", self.alternate_count)
|
|
|
|
add_string("imprint", self.imprint)
|
|
|
|
add_string("web_links", [str(x) for x in self.web_links])
|
|
|
|
add_string("format", self.format)
|
|
|
|
add_string("manga", self.manga)
|
|
|
|
|
|
|
|
add_string("price", self.price)
|
|
|
|
add_string("is_version_of", self.is_version_of)
|
|
|
|
add_string("rights", self.rights)
|
|
|
|
add_string("identifier", self.identifier)
|
|
|
|
add_string("last_mark", self.last_mark)
|
Code cleanup
Remove no longer used google scripts
Remove convenience files from comicataggerlib and import comicapi directly
Add type-hints to facilitate auto-complete tools
Make PyQt5 code more compatible with PyQt6
Implement automatic tooling
isort and black for code formatting
Line length has been set to 120
flake8 for code standards with exceptions:
E203 - Whitespace before ':' - format compatiblity with black
E501 - Line too long - flake8 line limit cannot be set
E722 - Do not use bare except - fixing bare except statements is a
lot of overhead and there are already
many in the codebase
These changes, along with some manual fixes creates much more readable code.
See examples below:
diff --git a/comicapi/comet.py b/comicapi/comet.py
index d1741c5..52dc195 100644
--- a/comicapi/comet.py
+++ b/comicapi/comet.py
@@ -166,7 +166,2 @@ class CoMet:
- if credit['role'].lower() in set(self.editor_synonyms):
- ET.SubElement(
- root,
- 'editor').text = "{0}".format(
- credit['person'])
@@ -174,2 +169,4 @@ class CoMet:
self.indent(root)
+ if credit["role"].lower() in set(self.editor_synonyms):
+ ET.SubElement(root, "editor").text = str(credit["person"])
diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py
index 4338176..9219f01 100644
--- a/comictaggerlib/autotagmatchwindow.py
+++ b/comictaggerlib/autotagmatchwindow.py
@@ -63,4 +63,3 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
self.skipButton, QtWidgets.QDialogButtonBox.ActionRole)
- self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(
- "Accept and Write Tags")
+ self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText("Accept and Write Tags")
diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py
index 688907d..dbd0c2e 100644
--- a/comictaggerlib/cli.py
+++ b/comictaggerlib/cli.py
@@ -293,7 +293,3 @@ def process_file_cli(filename, opts, settings, match_results):
if opts.raw:
- print((
- "{0}".format(
- str(
- ca.readRawCIX(),
- errors='ignore'))))
+ print(ca.read_raw_cix())
else:
2022-04-01 16:50:46 -07:00
|
|
|
|
|
|
|
if self.black_and_white:
|
2024-04-06 12:00:17 -07:00
|
|
|
add_string("black_and_white", self.black_and_white)
|
|
|
|
add_string("maturity_rating", self.maturity_rating)
|
|
|
|
add_string("story_arcs", self.story_arcs)
|
|
|
|
add_string("series_groups", self.series_groups)
|
|
|
|
add_string("scan_info", self.scan_info)
|
2023-09-24 06:33:57 -07:00
|
|
|
add_string("characters", ", ".join(self.characters))
|
|
|
|
add_string("teams", ", ".join(self.teams))
|
|
|
|
add_string("locations", ", ".join(self.locations))
|
2024-04-06 12:00:17 -07:00
|
|
|
add_string("description", self.description)
|
|
|
|
add_string("notes", self.notes)
|
2015-02-21 18:30:32 -08:00
|
|
|
|
2022-07-01 16:22:01 -07:00
|
|
|
add_string("tags", ", ".join(self.tags))
|
2015-02-21 18:30:32 -08:00
|
|
|
|
|
|
|
for c in self.credits:
|
|
|
|
primary = ""
|
2024-05-10 15:51:13 -07:00
|
|
|
if c.primary:
|
2015-02-21 18:30:32 -08:00
|
|
|
primary = " [P]"
|
2024-06-21 20:07:07 -07:00
|
|
|
add_string("credit", f"{c}{primary}")
|
2015-02-21 18:30:32 -08:00
|
|
|
|
|
|
|
# find the longest field name
|
|
|
|
flen = 0
|
|
|
|
for i in vals:
|
|
|
|
flen = max(flen, len(i[0]))
|
|
|
|
flen += 1
|
|
|
|
|
|
|
|
# format the data nicely
|
|
|
|
outstr = ""
|
2018-09-19 13:05:39 -07:00
|
|
|
fmt_str = "{0: <" + str(flen) + "} {1}\n"
|
2015-02-21 18:30:32 -08:00
|
|
|
for i in vals:
|
|
|
|
outstr += fmt_str.format(i[0] + ":", i[1])
|
|
|
|
|
|
|
|
return outstr
|
2022-04-18 18:44:20 -07:00
|
|
|
|
2022-05-19 13:28:18 -07:00
|
|
|
def fix_publisher(self) -> None:
|
2021-08-07 21:50:45 -07:00
|
|
|
if self.publisher is None:
|
|
|
|
return
|
|
|
|
if self.imprint is None:
|
|
|
|
self.imprint = ""
|
|
|
|
|
2022-05-19 13:28:18 -07:00
|
|
|
imprint, publisher = utils.get_publisher(self.publisher)
|
2021-08-07 21:50:45 -07:00
|
|
|
|
|
|
|
self.publisher = publisher
|
|
|
|
|
2022-07-01 16:22:01 -07:00
|
|
|
if self.imprint.casefold() in publisher.casefold():
|
2021-08-07 21:50:45 -07:00
|
|
|
self.imprint = None
|
|
|
|
|
|
|
|
if self.imprint is None or self.imprint == "":
|
|
|
|
self.imprint = imprint
|
2022-07-01 16:22:01 -07:00
|
|
|
elif self.imprint.casefold() in imprint.casefold():
|
2021-08-07 21:50:45 -07:00
|
|
|
self.imprint = imprint
|
2022-05-19 13:28:18 -07:00
|
|
|
|
2022-04-18 18:44:20 -07:00
|
|
|
|
2022-07-18 12:17:13 -07:00
|
|
|
md_test: GenericMetadata = GenericMetadata(
|
|
|
|
is_empty=False,
|
2024-06-20 16:47:10 -07:00
|
|
|
data_origin=MetadataOrigin("comicvine", "Comic Vine"),
|
2022-07-18 12:17:13 -07:00
|
|
|
series="Cory Doctorow's Futuristic Tales of the Here and Now",
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
series_id="23437",
|
2022-07-18 12:17:13 -07:00
|
|
|
issue="1",
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
issue_id="140529",
|
2022-07-18 12:17:13 -07:00
|
|
|
title="Anda's Game",
|
|
|
|
publisher="IDW Publishing",
|
|
|
|
month=10,
|
|
|
|
year=2007,
|
|
|
|
day=1,
|
|
|
|
issue_count=6,
|
|
|
|
volume=1,
|
2023-09-24 06:33:57 -07:00
|
|
|
genres={"Sci-Fi"},
|
2022-07-18 12:17:13 -07:00
|
|
|
language="en",
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
description=(
|
2022-07-18 12:17:13 -07:00
|
|
|
"For 12-year-old Anda, getting paid real money to kill the characters of players who were cheating"
|
|
|
|
" in her favorite online computer game was a win-win situation. Until she found out who was paying her,"
|
|
|
|
" and what those characters meant to the livelihood of children around the world."
|
|
|
|
),
|
|
|
|
volume_count=None,
|
|
|
|
critical_rating=3.0,
|
|
|
|
country=None,
|
|
|
|
alternate_series="Tales",
|
|
|
|
alternate_number="2",
|
|
|
|
alternate_count=7,
|
|
|
|
imprint="craphound.com",
|
|
|
|
notes="Tagged with ComicTagger 1.3.2a5 using info from Comic Vine on 2022-04-16 15:52:26. [Issue ID 140529]",
|
2024-02-17 15:08:36 -08:00
|
|
|
web_links=[
|
|
|
|
parse_url("https://comicvine.gamespot.com/cory-doctorows-futuristic-tales-of-the-here-and-no/4000-140529/")
|
|
|
|
],
|
2022-07-18 12:17:13 -07:00
|
|
|
format="Series",
|
|
|
|
manga="No",
|
|
|
|
black_and_white=None,
|
|
|
|
page_count=24,
|
|
|
|
maturity_rating="Everyone 10+",
|
Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
series_id: a string uniquely identifying the series to tag_origin
series_aliases: alternate series names that are not the canonical name
title_aliases: alternate issue titles that are not the canonical name
alternate_images: a list of urls to alternate cover images
Updated attributes for GenericMetadata:
genre -> genres: str -> list[str]
comments -> description: str -> str
story_arc -> story_arcs: str -> list[str]
series_group -> series_groups: str -> list[str]
character -> characters: str -> list[str]
team -> teams: str -> list[str]
location -> locations: str -> list[str]
tag_origin -> tag_origin: str -> TagOrigin (tuple[str, str])
ComicSeries has been relocated to the ComicAPI package, currently has no
usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
in the GUI when a series is selected and does not already contain the
needed fields, this function should always be cached.
A new split function has been added to ComicAPI, all uses of split on
single characters have been updated to use this
cleanup_html and the corresponding setting are now only used in
ComicTagger proper, for display we want any html directly from the
upstream. When applying the metadata we then strip the description of
any html.
A new conversion has been added to the MetadataFormatter:
j: joins any lists into a string with ', '. Note this is a valid
operation on strings as well, it will add ', ' in between every
character.
parse_settings now assigns the given ComicTaggerPaths object to the
result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
|
|
|
story_arcs=["Here and Now"],
|
|
|
|
series_groups=["Futuristic Tales"],
|
2022-07-18 12:17:13 -07:00
|
|
|
scan_info="(CC BY-NC-SA 3.0)",
|
2023-09-24 06:33:57 -07:00
|
|
|
characters={"Anda"},
|
|
|
|
teams={"Fahrenheit"},
|
|
|
|
locations=set(utils.split("lonely cottage ", ",")),
|
2022-07-18 12:17:13 -07:00
|
|
|
credits=[
|
2024-07-19 16:18:57 -07:00
|
|
|
merge.Credit(primary=False, person="Dara Naraghi", role="Writer"),
|
|
|
|
merge.Credit(primary=False, person="Esteve Polls", role="Penciller"),
|
|
|
|
merge.Credit(primary=False, person="Esteve Polls", role="Inker"),
|
|
|
|
merge.Credit(primary=False, person="Neil Uyetake", role="Letterer"),
|
|
|
|
merge.Credit(primary=False, person="Sam Kieth", role="Cover"),
|
|
|
|
merge.Credit(primary=False, person="Ted Adams", role="Editor"),
|
2022-07-18 12:17:13 -07:00
|
|
|
],
|
|
|
|
tags=set(),
|
|
|
|
pages=[
|
2024-07-19 16:18:57 -07:00
|
|
|
PageMetadata(
|
|
|
|
archive_index=0,
|
|
|
|
display_index=0,
|
|
|
|
height=1280,
|
|
|
|
byte_size=195977,
|
|
|
|
width=800,
|
|
|
|
type=PageType.FrontCover,
|
|
|
|
filename="!cover.jpg",
|
|
|
|
bookmark="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=1,
|
|
|
|
display_index=1,
|
|
|
|
height=2039,
|
|
|
|
byte_size=611993,
|
|
|
|
width=1327,
|
|
|
|
filename="01.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=2,
|
|
|
|
display_index=2,
|
|
|
|
height=2039,
|
|
|
|
byte_size=783726,
|
|
|
|
width=1327,
|
|
|
|
filename="02.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=3,
|
|
|
|
display_index=3,
|
|
|
|
height=2039,
|
|
|
|
byte_size=679584,
|
|
|
|
width=1327,
|
|
|
|
filename="03.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=4,
|
|
|
|
display_index=4,
|
|
|
|
height=2039,
|
|
|
|
byte_size=788179,
|
|
|
|
width=1327,
|
|
|
|
filename="04.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=5,
|
|
|
|
display_index=5,
|
|
|
|
height=2039,
|
|
|
|
byte_size=864433,
|
|
|
|
width=1327,
|
|
|
|
filename="05.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=6,
|
|
|
|
display_index=6,
|
|
|
|
height=2039,
|
|
|
|
byte_size=765606,
|
|
|
|
width=1327,
|
|
|
|
filename="06.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=7,
|
|
|
|
display_index=7,
|
|
|
|
height=2039,
|
|
|
|
byte_size=876427,
|
|
|
|
width=1327,
|
|
|
|
filename="07.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=8,
|
|
|
|
display_index=8,
|
|
|
|
height=2039,
|
|
|
|
byte_size=852622,
|
|
|
|
width=1327,
|
|
|
|
filename="08.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=9,
|
|
|
|
display_index=9,
|
|
|
|
height=2039,
|
|
|
|
byte_size=800205,
|
|
|
|
width=1327,
|
|
|
|
filename="09.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=10,
|
|
|
|
display_index=10,
|
|
|
|
height=2039,
|
|
|
|
byte_size=746243,
|
|
|
|
width=1326,
|
|
|
|
filename="10.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=11,
|
|
|
|
display_index=11,
|
|
|
|
height=2039,
|
|
|
|
byte_size=718062,
|
|
|
|
width=1327,
|
|
|
|
filename="11.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=12,
|
|
|
|
display_index=12,
|
|
|
|
height=2039,
|
|
|
|
byte_size=532179,
|
|
|
|
width=1326,
|
|
|
|
filename="12.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=13,
|
|
|
|
display_index=13,
|
|
|
|
height=2039,
|
|
|
|
byte_size=686708,
|
|
|
|
width=1327,
|
|
|
|
filename="13.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=14,
|
|
|
|
display_index=14,
|
|
|
|
height=2039,
|
|
|
|
byte_size=641907,
|
|
|
|
width=1327,
|
|
|
|
filename="14.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=15,
|
|
|
|
display_index=15,
|
|
|
|
height=2039,
|
|
|
|
byte_size=805388,
|
|
|
|
width=1327,
|
|
|
|
filename="15.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=16,
|
|
|
|
display_index=16,
|
|
|
|
height=2039,
|
|
|
|
byte_size=668927,
|
|
|
|
width=1326,
|
|
|
|
filename="16.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=17,
|
|
|
|
display_index=17,
|
|
|
|
height=2039,
|
|
|
|
byte_size=710605,
|
|
|
|
width=1327,
|
|
|
|
filename="17.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=18,
|
|
|
|
display_index=18,
|
|
|
|
height=2039,
|
|
|
|
byte_size=761398,
|
|
|
|
width=1326,
|
|
|
|
filename="18.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=19,
|
|
|
|
display_index=19,
|
|
|
|
height=2039,
|
|
|
|
byte_size=743807,
|
|
|
|
width=1327,
|
|
|
|
filename="19.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=20,
|
|
|
|
display_index=20,
|
|
|
|
height=2039,
|
|
|
|
byte_size=552911,
|
|
|
|
width=1326,
|
|
|
|
filename="20.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=21,
|
|
|
|
display_index=21,
|
|
|
|
height=2039,
|
|
|
|
byte_size=556827,
|
|
|
|
width=1327,
|
|
|
|
filename="21.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
|
|
|
),
|
|
|
|
PageMetadata(
|
|
|
|
archive_index=22,
|
|
|
|
display_index=22,
|
|
|
|
height=2039,
|
|
|
|
byte_size=675078,
|
|
|
|
width=1326,
|
|
|
|
filename="22.jpg",
|
|
|
|
bookmark="",
|
|
|
|
type="",
|
2023-12-18 02:37:34 -08:00
|
|
|
),
|
2024-07-19 16:18:57 -07:00
|
|
|
PageMetadata(
|
2023-12-17 21:47:43 -08:00
|
|
|
bookmark="Interview",
|
2024-07-19 16:18:57 -07:00
|
|
|
archive_index=23,
|
|
|
|
display_index=23,
|
|
|
|
height=2032,
|
|
|
|
byte_size=800965,
|
|
|
|
width=1338,
|
2023-12-17 21:47:43 -08:00
|
|
|
type=PageType.Letters,
|
2023-12-18 02:37:34 -08:00
|
|
|
filename="23.jpg",
|
2022-07-18 12:17:13 -07:00
|
|
|
),
|
|
|
|
],
|
|
|
|
price=None,
|
|
|
|
is_version_of=None,
|
|
|
|
rights=None,
|
|
|
|
identifier=None,
|
|
|
|
last_mark=None,
|
2023-12-17 15:51:43 -08:00
|
|
|
_cover_image=None,
|
2022-04-18 18:44:20 -07:00
|
|
|
)
|
2024-02-17 15:08:36 -08:00
|
|
|
|
|
|
|
|
|
|
|
__all__ = (
|
|
|
|
"Url",
|
|
|
|
"parse_url",
|
|
|
|
"PageType",
|
2024-07-19 16:18:57 -07:00
|
|
|
"PageMetadata",
|
2024-02-17 15:08:36 -08:00
|
|
|
"Credit",
|
|
|
|
"ComicSeries",
|
2024-06-20 16:47:10 -07:00
|
|
|
"MetadataOrigin",
|
2024-02-17 15:08:36 -08:00
|
|
|
"GenericMetadata",
|
|
|
|
)
|