Commit Graph
211 Commits
Author SHA1 Message Date
timmy 028b728d82 Improve file renaming
Moves to Python format strings for renaming, handles directory
structures, moving of files to a destination directory, sanitizes
file paths with pathvalidate and takes a different approach to
smart filename cleanup using the Python string.Formatter class

Moving to Python format strings means we can point to python
documentation for syntax and all we have to do is document the
properties and types that are attached to the GenericMetadata class.

Switching to pathvalidate allows comictagger to more simply handle both
directories and symbols in filenames.

The only changes to the string.Formatter class is:
1. format_field returns
an empty string if the value is none or an empty string regardless of
the format specifier.
2. _vformat drops the previous literal text if the field value
is an empty string and lstrips the following literal text of closing
special characters.
2022-04-18 18:52:53 -07:00
timmy e519bf79be Merge branch 'MichaelFitzurka-feature/263-pages-keyboard' into develop 2022-04-14 16:23:51 -07:00
MichaelFitzurka 544bdcb4e3 Using shortcuts and actions. 2022-04-14 12:22:53 -04:00
timmy f7f4e41c95 Catch exception when displaying raw tags 2022-04-11 17:16:07 -07:00
timmy 6da177471b Fix #242
Fix file encoding inconsistencies, windows defaults to cp1252, which is
not Unicode compatible.
Add logging for all exceptions in the comicapi package
Ensure that all exceptions are logged and shown to the user
2022-04-11 14:52:41 -07:00
MichaelFitzurka 8a74e5b02b Keyboard commands for the Pages tab to make editing easier. 2022-04-10 18:10:09 -04:00
timmy 6da3bf764e Merge branch 'feature/m-age-rating' of https://github.com/MichaelFitzurka/comictagger into MichaelFitzurka-feature/m-age-rating 2022-04-10 11:04:48 -07:00
timmy 5e06d35057 Merge branch 'feature/253-recalc-page-dims' of https://github.com/MichaelFitzurka/comictagger into MichaelFitzurka-feature/253-recalc-page-dims 2022-04-10 11:00:10 -07:00
timmy d7a6882577 Merge branch 'feature/183-comment-html-fix' of https://github.com/MichaelFitzurka/comictagger into MichaelFitzurka-feature/183-comment-html-fix 2022-04-10 10:59:00 -07:00
MichaelFitzurka d1a649c0ba Adding "M" age rating for 2.0 schema 2022-04-06 11:49:54 -04:00
MichaelFitzurka b7759506fe Menu command to clear out page size,height,width on demand, to then recalculate on save. 2022-04-05 16:23:26 -04:00
MichaelFitzurka 97777d61d2 Fixing some HTML to comment translations. 2022-04-05 16:16:27 -04:00
Michael Fitzurka d37022b71f Merge branch 'comictagger:develop' into feature/246-dbl-page 2022-04-05 09:59:20 -04:00
MichaelFitzurka 5f38241bcb Double Page functionality. 2022-04-05 09:52:59 -04:00
timmy 4fb9461491 Stop a crash when the logs folder already exists 2022-04-05 00:58:19 -07:00
timmy 558072a330 Create the logs folder before attempting to use it 2022-04-04 19:28:38 -07:00
timmy c50cef568e Add basic logging 2022-04-04 19:10:22 -07:00
MichaelFitzurka 4936c31c18 black changed some single quotes to double quotes. 2022-04-04 16:36:46 -04:00
MichaelFitzurka 1b28623fe3 Bookmark functionality. Fixes #212. 2022-04-03 15:44:20 -04:00
timmy e10f7dd7a7 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-02 14:21:37 -07:00
timmy 84dc148cff Merge branch 'MichaelFitzurka-feature/239-add-web-btn' into develop 2022-04-02 12:57:14 -07:00
MichaelFitzurka 2a3620ea21 Replacing requests validation with urlparse. 2022-04-01 09:48:53 -04:00
MichaelFitzurka 8c5d4869f9 Updates to comments. 2022-03-31 13:34:40 -04:00
MichaelFitzurka c0aa665347 Adding web link convenience button to open a valid url value in a browser window. 2022-03-31 12:40:43 -04:00
MichaelFitzurka 6900368251 Displaying invalid value with Error indicator, that way the user can see what is the invalid value and has the option to leave it or change it. 2022-03-31 10:25:00 -04:00
Michael Fitzurka 287c5f39c1 Merge branch 'comictagger:develop' into feature/179-7zip 2022-03-26 12:27:34 -04:00
MichaelFitzurka 86a83021a6 Update to look for images in data-src as well as src. 2022-03-21 15:29:31 -04:00
Michael Fitzurka d7595f5ca1 Merge branch 'comictagger:develop' into feature/179-7zip 2022-03-21 09:27:47 -04:00
timmy 5de2ce65a4 Remove print statements
Fixes #223
2022-03-20 10:40:30 -07:00
MichaelFitzurka ba71e61d87 Added 7zip support thru py7zr.
Tweaked save of archive file and images in comicarchive.
2022-03-18 15:14:42 -04:00
timmy 03b8bf4671 Bug fixes
Closes #65,#59,#154,#180,#187,#209
2022-02-21 20:05:07 -08:00
timmy b62e291749 Cleanup settings from #200
Rename blacklist to filter to be more accurate
2022-01-22 15:00:22 -08:00
thFrgttn a66b5ea0e3 Series sorting filtering (#200)
Because additional series results are now returned due to #143 the series selection window can with a large number of results that are not usually sorted in a useful way.

I've created 3 settings that can help finding the corect series quickly

use the publisher black list - can be toggled from the series selction screen, as well as a setting for is default behaviour
a setting to make the result initially sorted by start year instead of the default no of issues
a setting to initially put exact and near matches at the top of the list
2022-01-22 14:40:45 -08:00
timmy ed16199940 Merge pull request #132 from lordwelch/FixLanguageSort
Sort language correctly
2021-12-15 23:41:40 -08:00
timmy c6e1dc87dc Allow extended selection in the page list editor 2021-12-15 10:53:01 -08:00
timmy ef37158e57 Sort language correctly 2021-12-15 10:52:25 -08:00
J.P. Cranford 82d054fd05 Fixed typo 2021-12-14 16:52:48 -07:00
timmy d46e171bd6 Merge pull request #199 from lordwelch/seriesSearch
Improve issue identification
2021-09-26 17:09:54 -07:00
timmy e7fe520660 Improve issue identification
Move title sanitizing code to utils module
Update issue identifier to compare sanitized names
2021-09-26 17:06:30 -07:00
timmy 9e0b0ac01c Fix regression of #143 2021-09-25 22:59:59 -07:00
timmy 03a8d906ea Merge pull request #189 from lordwelch/seriesSearch
Series search
2021-09-21 19:59:26 -07:00
timmy fff28cf6ae Improve searchForSeries
Refactor removearticles to only remove articles
Add normalization on the search string and the series name results

Searching now only compares ASCII a-z and 0-9 and all other characters
are replaced with single space, this is done to both the search string
and the result. This fixes an with names that are separated by a
hyphen (-) in the filename but in the Comic Vine name are separated by a
slash (/) and other similar issues.
2021-08-29 17:35:34 -07:00
timmy 11bf5a9709 Move to python requests module
Add requests to requirements.txt
Requests is much simpler and fixes all ssl errors.
Comic Vine now requires a unique useragent string
2021-08-11 20:13:53 -07:00
timmy af4b3af14e Cleanup metadata handling
Mainly corrects for consistency in most situations
CoMet is not touched as there is no support in the gui and has an odd requirements on attributes
2021-08-07 21:54:29 -07:00
timmy 9bb7fbbc9e Fix errors
Libraries updated and these are no longer needed
2021-08-05 17:21:21 -07:00
davide-romanini c175e46b15 Increase comicvine search results per request to max (#164) 2019-10-06 07:14:11 -07:00
davide-romanini db3db48e5c Better console handling on Windows (#162) 2019-10-06 05:15:18 -07:00
davide-romanini cec585f8e0 Changed: use unrar-cffi for cbr handling (#151) 2019-10-05 23:59:52 +02:00
Davide Romanini f244255386 update urls to new github comictagger organization 2019-10-05 16:31:12 +02:00
Davide Romanini 7455cf17c8 fix broken drag & drop on macOS (#142) 2019-09-29 23:02:44 +01:00