Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-15-2020, 09:45 AM   #406
Magess
Member
Magess began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Dec 2020
Device: web
Quote:
Originally Posted by KevinH View Post
So for the latest JDK to work there must be no " or ' after the -Duser.dir= or it will barf.

So to get this to work we need to change the plugin.py to the following after the if isosx test:

Code:
    #----------------------------------------------------------------------                                                     
    # define epubcheck command line parameters                                                                                  
    #----------------------------------------------------------------------                                                     

    epc_path = os.path.join(plugin_path, 'epubcheck.jar')
    if is32bit:
	args = [java_path, '-Dfile.encoding=UTF8', '-Xss1024k', '-jar', epc_path, epub_path, '--version']
    else:
        if isosx:
            user_dir_value = '-Duser.dir=' + os.path.join(bk._w.plugin_dir, bk._w.plugin_name, 'temp.epub') + "/"
            args = [java_path, user_dir_value, '-Dfile.encoding=UTF8', '-jar', epc_path, epub_path, '--version']
        else:
            args = [java_path, '-Dfile.encoding=UTF8', '-jar', epc_path, epub_path, '--version']
I have no idea if this version without the quotes will work on older JDK's.

This is strange as under a real shell running in Terminal.app, using quotes around the for the --Duser.dir value works just fine.

So this is some interaction between the shell, and python3.8 subprocess and the very latest jdk's.

But we can just as easily change:

user_dir_value = '-Duser.dir=' + os.path.join(bk._w.plugin_dir, bk._w.plugin_name, 'temp.epub') + "/"

to:

user_dir_value = '-Duser.dir=/tmp'

And that is enough to work around the epubcheck bug.

I wonder if this is bash to zsh change related?
Is this something I as a user can do or something that has to be updated on the developer side?
Magess is offline   Reply With Quote
Old 12-15-2020, 10:06 AM   #407
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Magess View Post
Is this something I as a user can do or something that has to be updated on the developer side?
If you know your way around a text editor for programmers:

1. In Sigil, select Edit > Preference > Open Preferences Location
2. Double-click plugins > EpubCheck
3. Open plugin.py with a text editor and change the following line:

Code:
user_dir_value = '-Duser.dir=' + os.path.join(bk._w.plugin_dir, bk._w.plugin_name, 'temp.epub') + "/"
to:

Code:
user_dir_value =  '-Duser.dir=/tmp'
4. Save plugin.py and test whether the EpubCheck plugin works.

(I can't test this myself because I don't have access to a Mac.)
Doitsu is offline   Reply With Quote
Advert
Old 12-15-2020, 10:14 AM   #408
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,860
Karma: 6120478
Join Date: Nov 2009
Device: many
I played around with the code enough so it probably doesn't match what is in an official epubcheck plugin.py anymore.

I will pm you an official patch against your current plugin for you to consider including in a future release. Hopefully epubcheck people will fix this soon and all of this extra macOS code can go away.

Last edited by KevinH; 12-15-2020 at 01:20 PM.
KevinH is offline   Reply With Quote
Old 12-15-2020, 10:59 AM   #409
Magess
Member
Magess began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Dec 2020
Device: web
Quote:
Originally Posted by Doitsu View Post
4. Save plugin.py and test whether the EpubCheck plugin works.

(I can't test this myself because I don't have access to a Mac.)
Yep, it works! Thank you
Magess is offline   Reply With Quote
Old 12-15-2020, 02:07 PM   #410
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
I've attached a new version for macOS users with the changes suggested by KevinH.
If you're not a macOS user you can ignore this update.
Doitsu is offline   Reply With Quote
Advert
Old 12-15-2020, 03:42 PM   #411
jennie2486
Member
jennie2486 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2017
Device: Android Tablet
Quote:
What are your Windows and Sigil versions?
Please delete EpubCheck.json file… and re-install the plugin.
I am running Windows 10 Pro version 1909 and Sigil 1.4.3.
I tried deleting the EPUBCheck.json and re-installing the plugin which didn't work.
jennie2486 is offline   Reply With Quote
Old 12-15-2020, 04:38 PM   #412
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by jennie2486 View Post
I am running Windows 10 Pro version 1909 and Sigil 1.4.3.
I tried deleting the EPUBCheck.json and re-installing the plugin which didn't work.
The error message that you got is only displayed if either the java binary or the .jar file in the plugin folder can't be found.

Are you sure that java -version works when you simply open a Windows command prompt window (CMD) without specifying the full path to the java binary or using cd to change the directory?

If so, I can't help you, because I can't reproduce your problem. Otherwise, please follow the instructions on the download page for adding the Java binary path to the path environment variable.

Alternatively, you can also specify the Java binary path in EpubCheck.json.

For example, on my machine I'd need to use:
Code:
  "java_path": "C:/Program Files/Java/jre1.8.0_241/bin/java.exe",
instead of

Code:
  "java_path": "java",
Obviously, you'll need to change the Java binary path, because you most likely have a more recent Java version.

Last edited by Doitsu; 12-15-2020 at 04:41 PM.
Doitsu is offline   Reply With Quote
Old 12-18-2020, 11:55 AM   #413
jennie2486
Member
jennie2486 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2017
Device: Android Tablet
Quote:
The error message that you got is only displayed if either the java binary or the .jar file in the plugin folder can't be found.
To check Java I run and receive:
Code:
java -version

C:\Program Files\Java\jre1.8.0_251\bin\java.exe
I also checked the JAVA_HOME path in terminal and received:
Code:
echo %JAVA_HOME%

C:\Progra~1\Java\jre1.8.0_251\bin\java.exe
But, just in case, I also specified the java binary path in the EpubCheck.json file. Still didn't work.

If it was a java or EpubCheck error, wouldn't I then have trouble running the plugin through terminal and Calibre, not to mention some of the other plugins that also rely on Java?

Calibre works fine, and displays all errors correctly, I've never had any issues at all with Calibre. Since I find myself using Sigil more often, I wanted to get EpubCheck and some other plugins working.

I run and receive on terminal the following:

Code:
java -jar  "C:\Users\jenni\AppData\Local\sigil-ebook\sigil\plugins\EpubCheck\epubcheck.jar"

At least one argument expected
EPUBCheck completed
I can also successfully check books using terminal, no problem:

Code:
 java -jar "C:\Users\jenni\OneDrive\Downloads\Sigil Plugins\EpubCheck\epubcheck.jar" "C:\Users\jenni\OneDrive\Documents\Books\Looking for Clara_ A Novel (6192)\Looking for Clara_ A Novel - Simona Grossi_epub3.epub"

Validating using EPUB version 3.2 rules.
ERROR(OPF-014): C:/Users/jenni/OneDrive/Documents/Books/books/Looking for Clara_ A Novel (6192)/Looking for Clara_ A Novel - Simona Grossi_epub3.epub/OEBPS/Section41.xhtml(-1,-1): The property "remote-resources" should be declared in the OPF file.
ERROR(RSC-006): C:/Users/jenni/OneDrive/Documents/Books/books/Looking for Clara_ A Novel (6192)/Looking for Clara_ A Novel - Simona Grossi_epub3.epub/OEBPS/Section41.xhtml(24,28): Remote resource reference not allowed; resource must be placed in the OCF.

Check finished with errors
Messages: 0 fatals / 2 errors / 0 warnings / 0 infos

EPUBCheck completed
This is so frustrating, only Sigil seems to have an issue.
jennie2486 is offline   Reply With Quote
Old 12-18-2020, 12:26 PM   #414
jennie2486
Member
jennie2486 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2017
Device: Android Tablet
Quote:
I run and receive on terminal the following:
Code:
java -jar   "C:\Users\jenni\AppData\Local\sigil-ebook\sigil\plugins\EpubCheck\epubcheck.jar"

At least one argument expected
EPUBCheck completed
Just noticed there was an extra space in the above. (I wasn't able to edit the post)

It should read:
Code:
java -jar  "C:\Users\jenni\AppData\Local\sigil-ebook\sigil\plugins\EpubCheck\epubcheck.jar"

At least one argument expected
EPUBCheck completed
jennie2486 is offline   Reply With Quote
Old 12-18-2020, 02:26 PM   #415
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
I wish I could help you, but I can't reproduce your problem.

Try the following:

1. Select Edit > Preferences > Open Preferences Location > plugins_prefs > EpubCheck

2. Open EpubCheck.json with a text editor, for example, Notepad or Notepad++.

3. Insert the following line (marked in blue) at the beginning, before the first entry:

Code:
{
  "debug": true,
  "update_check": true,
and save EpubCheck.json.

4. Run EpubCheck, copy the complete output and paste it here.

Note that this change will actually cause the plugin to fail, but it should display additional information.
Doitsu is offline   Reply With Quote
Old 12-20-2020, 02:42 AM   #416
jennie2486
Member
jennie2486 began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Feb 2017
Device: Android Tablet
Quote:
I wish I could help you, but I can't reproduce your problem.
I'm glad to say EpubCheck is working just fine through Sigil, now. I have no idea what changed… I actually went to run another plugin, but the cursor missed and hit EpubCheck. Wouldn't you know it, it worked! I can't figure it. I had just about given up hope, when even after verifying the environment variables path, and even stating the Java path in the plugin, it still wouldn't work. I have no idea what has changed since yesterday when it was definitely not working.

Well, it works! I'm happy. I could have made do with EpubCheck through Calibre and command line, but it's more convenient when I'm already in Sigil.

Thanks for your help.
jennie2486 is offline   Reply With Quote
Old 12-20-2020, 07:38 AM   #417
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,664
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Changing user env vars sometimes require logging back in to take effect. And depending on how/when the JAVA_HOME variable is being set, it may not be available to the python subprocess that Sigil kicks off for the plugin. The best option (especially if you have multiple versions of java installed) is to specify the full path to the binary of the version you want the plugin to use in the plugin's preferences json file. You probably also want to be certain no instances of Sigil are currently open when editing/saving the json file for good measure.

And also use forward slashes in the path specified in the json file rather than backslashes. If you use backslashes, you would probably need to double them. C:\\Program Files\\...

Don't use the shortened path format (C:\Progra~1\) in the json file either. It's just a string and the full--real--path will never get substituted when the python subprocess uses it.

"java_path": "C:/Program Files/Java/jre1.8.0_251/bin/java.exe",

Is what you want in the json file.
DiapDealer is offline   Reply With Quote
Old 12-20-2020, 02:08 PM   #418
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,754
Karma: 169712580
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by jennie2486 View Post
To check Java I run and receive:
Code:
java -version
Code:
I find it rather curious that you got the path to the java executable echoed from java -version rather than the version information.  What I see is:

Code:
Microsoft Windows [Version 10.0.19042.685]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\David>java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

C:\Users\David>
Quote:
Originally Posted by jennie2486 View Post
I also checked the JAVA_HOME path in terminal and received:
Code:
echo %JAVA_HOME%

C:\Progra~1\Java\jre1.8.0_251\bin\java.exe
On my system, I don't have JAVA_HOME set.

Out of curiosity, is the path to the Java executable in your path variable? I have two entries in there, "C:\Program Files (x86)\Common Files\Oracle\Java\javapath;" and "C:\Program Files\Java\jre1.8.0_271\bin\;'

Last edited by DNSB; 12-20-2020 at 02:16 PM. Reason: Added question about path variable
DNSB is offline   Reply With Quote
Old 03-31-2021, 12:24 PM   #419
Violand
Member
Violand began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2020
Device: Kindle Paperwhite
Hi, I report this problem with Sigil 1.5.1 (Win 10) when User Interface Language is "Italian":

Stato: failed

Traceback (most recent call last):
File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 142, in launch
self.exitcode = target_script.run(container)
File "C:\Users\Angelo\AppData\Local\sigil-ebook\sigil\plugins\EpubCheck\plugin.py", line 205, in run
translations = gettext.translation('messages', localedir=localedir, languages=[locale])
File "gettext.py", line 588, in translation
FileNotFoundError: [Errno 2] No translation file found for domain: 'messages'
Error: [Errno 2] No translation file found for domain: 'messages'


No probem when language is english
Violand is offline   Reply With Quote
Old 03-31-2021, 02:35 PM   #420
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Violand View Post
Hi, I report this problem with Sigil 1.5.1 (Win 10) when User Interface Language is "Italian":
I'm sorry, somehow I forgot to include the Italian translation file. Please download the fixed version that I attached to the first post.
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] PunctuationSmarten Sigil plugin DiapDealer Plugins 143 07-30-2025 06:58 AM
[Plugin] KindleImport Sigil plugin DiapDealer Plugins 187 07-04-2022 10:11 AM
Sigil Plugin Index Thasaidon Plugins 0 10-04-2014 07:41 AM
FC and Sigil 0.5.3 ePUBcheck failure Hitch Sigil 32 04-17-2012 02:56 AM
Web-based epubcheck upgraded to epubcheck 1.0.5 kjk ePub 4 02-09-2010 09:53 PM


All times are GMT -4. The time now is 07:05 AM.


MobileRead.com is a privately owned, operated and funded community.