Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-05-2018, 09:11 PM   #31
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,089
Karma: 1221485
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
the editor does work independently of the main program. @Doitsu when you call subprocess to run epubcheck, you should specify the creationflags variable to ensure cd window is not created. something like

Code:
import win32process
subprocess.Popen(...., creationflags=win32process.CREATE_NO_WINDOW)
Thanks for the help, Kovid!


Quote:
Originally Posted by Doitsu View Post
Thanks for the code snippet! I'll add it to the plugin and release a new version today.
Thanks Doitsu for the quick correction. It works perfectly now!
thiago.eec is offline   Reply With Quote
Old 11-26-2018, 10:40 PM   #32
kobayashi
Groupie
kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!
 
Posts: 176
Karma: 100000
Join Date: Jan 2015
Device: KA1
The 0.1.4 update causes Calibre to hang and never update on my Mac.
kobayashi is offline   Reply With Quote
Advert
Old 11-27-2018, 12:28 AM   #33
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,697
Karma: 5514284
Join Date: Mar 2015
Device: Kindle, iOS
Quote:
Originally Posted by kobayashi View Post
The 0.1.4 update causes Calibre to hang and never update on my Mac.
Can you provide more details? Just tested this on my Mac, and it's working for me.
odamizu is offline   Reply With Quote
Old 11-27-2018, 05:26 AM   #34
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,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by kobayashi View Post
The 0.1.4 update causes Calibre to hang and never update on my Mac.
Most likely the file download was incomplete. Please re-download the plugin zip file and generate an MD5 checksum for it:
  1. Open a terminal window.
  2. Enter md5
  3. Drag & drop EpubCheck.zip from the Downloads folder to the Terminal window and hit Enter.

The MD5 value should be 040b7ec0fb115afee69441384cb20017.
Doitsu is offline   Reply With Quote
Old 11-27-2018, 09:40 AM   #35
kobayashi
Groupie
kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!kobayashi rocks like Gibraltar!
 
Posts: 176
Karma: 100000
Join Date: Jan 2015
Device: KA1
Quote:
Originally Posted by Doitsu View Post
Most likely the file download was incomplete. Please re-download the plugin zip file and generate an MD5 checksum for it:
  1. Open a terminal window.
  2. Enter md5
  3. Drag & drop EpubCheck.zip from the Downloads folder to the Terminal window and hit Enter.

The MD5 value should be 040b7ec0fb115afee69441384cb20017.
That may have been the issue. Tried it again this morning and it worked as normal.
kobayashi is offline   Reply With Quote
Advert
Old 11-27-2018, 12:08 PM   #36
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,482
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I've just run the new version for the first time with the Calibre editor. I have gotten 18 warnings. Would it be possible to fix the plugin so we can see the warnings and fix them if we want? Thanks.
JSWolf is offline   Reply With Quote
Old 11-27-2018, 01:27 PM   #37
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,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by JSWolf View Post
I have gotten 18 warnings. Would it be possible to fix the plugin so we can see the warnings and fix them if we want?
I don't understand your problem. The new version might display more warnings, but other than that it should behave exactly as the old version.
If it doesn't, please provide more details.
Doitsu is offline   Reply With Quote
Old 11-27-2018, 07:37 PM   #38
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,089
Karma: 1221485
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Thank you for the update, @Doitsu. That was fast!
thiago.eec is offline   Reply With Quote
Old 11-28-2018, 12:41 AM   #39
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: 40,588
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Doitsu View Post
I don't understand your problem. The new version might display more warnings, but other than that it should behave exactly as the old version.
If it doesn't, please provide more details.
When I played with it, I detached the postage stamp sized window used for epubcheck's output and dumped it on a second monitor where I resized it to a more useful size. I used a couple of test files and had 5 more errors using the new version than the old version generated.
Attached Thumbnails
Click image for larger version

Name:	epubcheck_docked.PNG
Views:	444
Size:	3.8 KB
ID:	168039   Click image for larger version

Name:	epubcheck_undocked.PNG
Views:	454
Size:	187.9 KB
ID:	168040  
DNSB is offline   Reply With Quote
Old 11-28-2018, 04:07 AM   #40
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,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Hi David,

Quote:
Originally Posted by DNSB View Post
I detached the postage stamp sized window used for epubcheck's output and dumped it on a second monitor
You can have the plugin automatically close the Check book panel. (You can also have the plugin copy the raw EPUBCheck messages to the system clipboard, by adding a "clipboard_copy": true entry to EpubCheck.json.)

Quote:
Originally Posted by DNSB View Post
I used a couple of test files and had 5 more errors using the new version than the old version generated.
Thanks for your report. Can you please post the five error messages and the code fragments that they refer to?

BTW, the only additional message that I got for files created by very old Calibre/Sigil versions was:

Code:
ERROR(NCX-001): temp.epub/OEBPS/toc.ncx(-1,-1): NCX identifier ('xxx') does 
not match OPF identifier ('urn:uuid:xxx').
And this message is by design:

Quote:
Features
...
report non-matching identifiers in OPF and NCX as an error again (515682dc)
...
D.
Doitsu is offline   Reply With Quote
Old 11-28-2018, 07:19 PM   #41
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: 40,588
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Doitsu View Post
Thanks for your report. Can you please post the five error messages and the code fragments that they refer to?
I fixed the errors so don't have the original document anymore. I think one of the errors was related to an empty [tours][/tours] entry in content.opf.
DNSB is offline   Reply With Quote
Old 12-01-2018, 10:45 AM   #42
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,089
Karma: 1221485
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Pass further arguments do EPUBCheck

Hi, @Doitsu

Altough I'm a complete noob to python (an to programming in general), I was trying to modify your plugin so I could pass the "--usage" argument to epubcheck. I've tried changing this lines:


Spoiler:
Code:
line 131:   args = ['java', '-jar', epc_path, '--version', epub_path]
to
Code:
line 131:   args = ['java', '-jar', epc_path, '--version', epub_path, '--usage']


Spoiler:
Code:
line 163:   if line.startswith(('ERROR', 'WARNING', 'FATAL', 'INFO')):
to
Code:
line 163:   if line.startswith(('ERROR', 'WARNING', 'FATAL', 'INFO', 'USAGE')):


Spoiler:
Code:
line 295:   elif err_code.startswith('WARNING'):
to
Code:
line 295:   elif err_code.startswith(('WARNING', 'USAGE')):


But I got no luck... Is this possible? Am I just missing some other reference or it would need a more profound change to the code?

EDIT: Of course this wouldn't be default behavior. It could be enabled by another entry to EpubCheck.json. Somethin like "usage": true.

Last edited by thiago.eec; 12-01-2018 at 01:03 PM.
thiago.eec is offline   Reply With Quote
Old 12-01-2018, 12:33 PM   #43
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,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by thiago.eec View Post
Am I just missing some other reference or it would need a more profound change to the code?
For someone who claims to be a noob, you've made all the right changes.
However, you (and I) underestimated the EPUBCheck developers. Since they don't consider USAGE messages errors, all USAGE messages are written to stdout not stderr.

Since the plugin only checked stderr for error messages, they were ignored.

Your changes should work if you also add the following line:

Code:
                stderr = result[1].decode(os_encoding)
                stderr += stdout
Make sure not to use tabs for the indentation; it'd best if you copied the line before it and edited it.

(I've also attached an updated version of main.py for your convenience.)

Quote:
Originally Posted by thiago.eec View Post
EDIT: Of course this wouldn't be default behavior. It could be enabled by another entry to EpubCheck.json. Somethin like "usage": true.
I might add an "usage": true option in the next version.
Attached Files
File Type: py main.py (15.1 KB, 438 views)
Doitsu is offline   Reply With Quote
Old 12-01-2018, 01:03 PM   #44
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,089
Karma: 1221485
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by Doitsu View Post
For someone who claims to be a noob, you've made all the right changes.
I'm just good at guessing... I can read most of the codes in plugins and make small tweaks. If it gets a little deeper, than I'm in trouble.

Quote:
Originally Posted by Doitsu View Post
(I've also attached an updated version of main.py for your convenience.)
Thank you very much for the quick reply and the altered script.


EDIT: Got it reading from EpubCheck.json now.
Attached Files
File Type: py main.py (15.3 KB, 456 views)

Last edited by thiago.eec; 12-01-2018 at 01:32 PM.
thiago.eec is offline   Reply With Quote
Old 12-01-2018, 02:46 PM   #45
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,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by thiago.eec View Post
Got it reading from EpubCheck.json now.
Good job!
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
epubcheck plugin for Sigil Doitsu Plugins 533 10-24-2024 04:32 PM
Open Metadata Editor from plugin notbuu Development 5 10-05-2016 01:10 AM
Sample Plugin for the Editor DiapDealer Editor 77 12-10-2014 08:16 AM
Editor plugin question DiapDealer Development 2 07-28-2014 11:23 PM
Web-based epubcheck upgraded to epubcheck 1.0.5 kjk ePub 4 02-09-2010 10:53 PM


All times are GMT -4. The time now is 10:55 AM.


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