MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   [Plugin] Access-Aide - help improve epub accessibility (https://www.mobileread.com/forums/showthread.php?t=294900)

BeckyEbook 02-03-2021 07:47 PM

IMHO, because on Linux the bookpath is immediately compatible and the problem does not occur.

https://www.geeksforgeeks.org/python...rmcase-method/

DiapDealer 02-03-2021 07:49 PM

os.path.normcase makes no changes whatsoever on platforms other than Windows... where it converts everything to lowercase and converts forward slashes to backslashes.

KevinH 02-03-2021 07:53 PM

So exactly what I do not want ... so can I just remove them completely on Windows as the url itself is case sensitive. Since I am rebuilding a url (a book root relative url) then normcase is not the correct thing since I am not looking for a file path.

So I only need it when looking for a file on the filesystem, correct?

KevinH 02-03-2021 08:06 PM

Just to verify, in plugin.py there are 5 lines that use normcase. Each operates on itself and stores the result back in itself. So if you just delete all 5 lines and try again on Windows, does it all work?

On Windows, if a file in an epub has a name "Chapter.xhtml" on the disk itself, is the file stored as "chapter.xhtml" or "CHAPTER.XHTML".

On macOs there are both case sensitive and case insensitive filesystems. I typically always use a case-sensitive file system. But on macOS, even the case-insensitive file system is case-preserving, so the last access case becomes the full name (at least that the user sees).

DiapDealer 02-03-2021 08:09 PM

Quote:

Originally Posted by KevinH (Post 4089605)
So I only need it when looking for a file on the filesystem, correct?

That would be my take, yes.

DiapDealer 02-03-2021 08:34 PM

Quote:

Originally Posted by KevinH (Post 4089610)
Just to verify, in plugin.py there are 5 lines that use normcase. Each operates on itself and stores the result back in itself. So if you just delete all 5 lines and try again on Windows, does it all work?

It seems to, yes. I still get the spaces added after "<?xml" in the xml header, though. Was that narrowed down to a Windows-only issue?

Quote:

Originally Posted by KevinH (Post 4089610)
On Windows, if a file in an epub has a name "Chapter.xhtml" on the disk itself, is the file stored as "chapter.xhtml" or "CHAPTER.XHTML".

Not sure I know the answer to that. Do you mean in the zip archive on the disk in general, or when extracted in Sigil's scratch area specifically? Filesystem internals are not at all my forte. :o

KevinH 02-03-2021 11:38 PM

The xml header space is a serialization bug in quickparser.py that is part of the plugin_launcher code. I pushed a fix for that earlier today.

I will remove those five lines and post an official 0.5.2 version of AccessAide.

Thanks for everyone's help!

KevinH 02-04-2021 12:19 AM

New version of Access-Aide now available in post 1 of this thread.

Changes include:

v052
- no longer consider whitespace alone a valid xhtml title
- properly look for and handle self-closed title tags in head when looking
to replace titles
- work around for quickparser.py serialization bug in Sigil v1.4.3 and earlier
- no longer strip region off dc:language code
- fix Windows specific bug when epub files use mixed case


Special thank you to BeckyEbook, DiapDealer, Doitsu, and DNSB for tracking this one down and helping out with testing. Of course thanks also go to thiago.eec for reporting the bug in the first place and providing the test case.

thiago.eec 02-04-2021 06:27 AM

Thank you all! It's working fine now on Windows. :thanks:

DiapDealer 02-04-2021 07:31 AM

I love a happy ending. :D

KevinH 08-20-2021 03:20 PM

New version 0.5.3 released: See first post of this thread for the plugin zip or my github site.

Changes:

- scaling wide but very thin height images by the gui could cause new scaled height to truncate to 0 pixels incorrectly. Now minimum scaled height is 1 pixel.

Prevent PIL module from throwing an error.

KevinH 09-17-2021 12:24 PM

New version 0.5.4 released: See first post of this thread for the plugin zip or my github site.

Changes:

- add support for schema:accessibilityHazard none

The schema:accessibilityHazard set to none indicates you are using only *static* images with no Video and no animated gifs. You need to verify that or update that metadata as appropriate.

genossin 11-15-2021 09:44 AM

Dear Kevin Hendrick,
i´ve installed the latest version 054 from github to my sigil installation 1.8.0 on mac os x big sur.
The Plugin is shown under the plugin-section (used the reccomanded zip file). I´ve also checked the box "integrated python-interpreter" . If i start the plugin (which is also shown with the correct icon on the toolbar) it dont work, here the failure-message:

Status: failed

Traceback (most recent call last):
File "/Applications/Sigil.app/Contents/plugin_launchers/python/launcher.py", line 141, in launch
target_script = import(script_module)
File "/Users/anke/Library/Application Support/sigil-ebook/sigil/plugins/Access-Aide/plugin.py", line 24, in
from accessgui import GUIUpdateFromList
File "/Users/anke/Library/Application Support/sigil-ebook/sigil/plugins/Access-Aide/accessgui.py", line 16, in
from PIL import Image, ImageTk
File "site-packages/PIL/ImageTk.py", line 28, in
File "tkinter/init.py", line 36, in
ImportError: dlopen(/Applications/Sigil.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so, 2): Library not loaded: /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl
Referenced from: /Applications/Sigil.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so
Reason: image not found
Error: dlopen(/Applications/Sigil.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so, 2): Library not loaded: /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl
Referenced from: /Applications/Sigil.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so
Reason: image not found

maybe its a known issue and you could help? am i doing wrong?
python 3 is existing also: /usr/bin/python3.
p.s.: im using the german version of sigil.

greetings, anke

Doitsu 11-15-2021 09:52 AM

macOS users will need to manually install the TclTk library.

Try installing the TclTk_8.6.12.dmg package from the official download website.
If it doesn't work, please post about it in the MacOS ActiveState TCL 8.6.x and Sigil issue thread.

KevinH 11-15-2021 11:30 AM

Yes ... the TclTk_8.6.12.dmg has now been updated to work on macOS Catalina and later. The version posted previously only worked on Mojave and earlier. The new version should work on all. If you downloaded TclTk_8.6.12.dmg recently, you should grab the current version posted there now.


All times are GMT -4. The time now is 08:24 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.