View Single Post
Old 02-03-2021, 08:12 AM   #3
wolf123
Member
wolf123 began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Jun 2020
Device: nook simple touch
Thank you so much!!

There were two python3 compatibility issues. The plugin now works correctly.

If this could be useful to others, I debugged the file using 2to3
Code:
$ 2to3-2.7 main.py 
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored main.py
--- main.py	(original)
+++ main.py	(refactored)
@@ -12,7 +12,7 @@
 from calibre_plugins.access_aide.config import prefs
 
 # My modules
-from lib.stats import Stats
+from .lib.stats import Stats
 
 
 class AccessAide(Tool):
@@ -61,7 +61,7 @@
         blacklist = ['toc.xhtml']
 
         # iterate over book files
-        for name, media_type in container.mime_map.items():
+        for name, media_type in list(container.mime_map.items()):
 
             if media_type in OEB_DOCS \
                and name not in blacklist:
RefactoringTool: Files that need to be modified:
RefactoringTool: main.py
wolf123 is offline   Reply With Quote