MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   Plugin Development (https://www.mobileread.com/forums/showthread.php?t=251452)

Doitsu 11-25-2014 01:54 PM

Quote:

Originally Posted by DiapDealer (Post 2985780)
Do you have the compatibility_utils installed? The latest one?

I've only installed the updates posted in this thread. If there was one for compatibility_utils.py I must have missed it.

BTW, given the many updates, it'd be helpful if the plugin launcher files had version numbers in the comments section.

Quote:

Originally Posted by DiapDealer (Post 2985780)
At this point, your best bet is to grab all the latest launcher files from Kevin's github and then replace launcher.py with the most recent one he posted in this thread. That's what I did with Sigil 0.8.1 and everything worked as it should.

I assumed that the current Github laucher files have been updated for the upcoming 0.8.2 version. For example, there are validator plugin python files, but, AFAIK, Sigil 0.8.1 doesn't have validator plugin support.
Anyway after grabbing the latest compatibility_utils.py version from Github the error disappeared.

Toxaris 11-25-2014 02:08 PM

Quote:

Originally Posted by KevinH (Post 2985732)
Hi Toxaris,

I stole a free moment at work to try and turn off the feature that allows plugin prints to appear immediately in the Sigil window. This feature requires changes in Sigil as well.

So please try the following version of launcher.py that should disable this new feature and hopefully work for you.

Sorry about that. I keep forgetting that Sigil 0.8.2 is not out yet!

KevinH

ps. To get around your second error you will need to add the following files to the plugin_launcher as well (after unzipping).

No problem at all. I replaced all the files and I do get further. Now I get a popup saying: Error parsing result XML: Start tag expected

Then I see the results, but they are not pushed to Sigil.

KevinH 11-25-2014 03:15 PM

Hi Toxaris,

The second modified launcher.py should have handled that error but I guess it did not. DiapDealer has said he needs other files from the new launcher as well to get anything to work with the Sigil 0.8.1 build.

So I will put together a full set when I get home from work tonight and modify them to work with Sigil 0.8.1 so that you have something to continue development with while we wait for Sigil 0.8.2 to officially come out.

Take care,

KevinH

Quote:

Originally Posted by Toxaris (Post 2985799)
No problem at all. I replaced all the files and I do get further. Now I get a popup saying: Error parsing result XML: Start tag expected

Then I see the results, but they are not pushed to Sigil.


Doitsu 11-25-2014 04:47 PM

Hi KevinH,

I installed all new files and didn't get any error messages. However, my test case still doesn't fully work.
When I add and remove a font with bk.addfile() and bk.deletefile (using the code that I've already posted), the font is added and subsequently removed from the .opf file and the Book View Fonts folder, but when I unzip the saved ePub file, it's still in the Fonts folder.

D.

KevinH 11-25-2014 05:05 PM

Hi Doitsu,

I am confused. If you use bk.addfile to add a new file to the ebook and then use bk.deletefile to remove that same file, you should net to no change in the underlying epub? Or are you saying that a deletefile on some other file will not work after any addfile?

Please post your full testcase so that I can recreate what you are seeing exactly. The only code you had posted previously was mixing addfile and deleteotherfile which is always a mistake. If the file has been added to the manifest with addfile, you should delete it with deletefile NOT deleteotherfile.

Thanks,


Kevin



Quote:

Originally Posted by Doitsu (Post 2985903)
Hi KevinH,

I installed all new files and didn't get any error messages. However, my test case still doesn't fully work.
When I add and remove a font with bk.addfile() and bk.deletefile (using the code that I've already posted), the font is added and subsequently removed from the .opf file and the Book View Fonts folder, but when I unzip the saved ePub file, it's still in the Fonts folder.

D.


Doitsu 11-25-2014 05:16 PM

Hi Kevin,

Quote:

Originally Posted by KevinH (Post 2985916)
I am confused. If you use bk.addfile to add a new file to the ebook and then use bk.deletefile to remove that same file, you should net to no change in the underlying epub? Or are you saying hat a deletefile on some other file will not work after any addfile?

To test bk.deletefile() I opened Sigil without a book ran the original plugin, which added the font file to the epub. So far so good. I then saved the file, reopened it, changed the the last file in the plugin code from:

Code:

    bk.addfile('doitsu', binary_file, data, 'application/x-font-ttf')
to:

Code:

    bk.deletefile('doitsu')
I then ran the modified plugin again, which removed the font that I added during the first run from the .opf file and the Book View Fonts folder but not the actual Fonts folder in the epub.

D.

KevinH 11-25-2014 05:56 PM

Hi Doitsu!

Yes that is a bug! I can now recreate this when trying to delete any file in the original ebook. It just appears to go away but is still there somehow.

Unfortunately this bug is in the Sigil code base and not the launcher code so I can't fix this until the upcoming release, which should be soon but ...

I have just now committed a fix for this to my tree so that it is available when user-none does the official Sigil 0.8.2 builds. With this change Sigil will actually do the "physical" removal as well as the "logical" removal of the ebook.

There is no workaround I can do from my end. If you work on a Mac, I would be happy to build you a pre-release version of Sigil 0.8.2 so that you can continue to work. If Linux, I could probably get a Linux build done as well. Unfortunately, I do not own a Windows box and so could not make a build for you but perhaps DiapDealer would be willing to share his once he updates from my github tree to get this Sigil fix.

Thanks ever so much for catching this bug before the release!!!!!!

Take care,

Kevin


Quote:

Originally Posted by Doitsu (Post 2985922)
Hi Kevin,

To test bk.deletefile() I opened Sigil without a book ran the original plugin, which added the font file to the epub. So far so good. I then saved the file, reopened it, changed the the last file in the plugin code from:

Code:

    bk.addfile('doitsu', binary_file, data, 'application/x-font-ttf')
to:

Code:

    bk.deletefile('doitsu')
I then ran the modified plugin again, which removed the font that I added during the first run from the .opf file and the Book View Fonts folder but not the actual Fonts folder in the epub.

D.


Doitsu 11-25-2014 06:04 PM

Hi Kevin,

Quote:

Originally Posted by KevinH (Post 2985959)
Thanks ever so much for catching this bug before the release.

Actually, all the credit goes to Toxaris who found the bug in the first place.

Quote:

Originally Posted by KevinH (Post 2985959)
There is no workaround I can do from my end. If you work on a Mac, I would be happy to build you a pre-release version of Sigil 0.8.2 so that you can continue to work. If Linux, I could probably get a Linux build done as well.

Thanks for the kind offer, but I'm going to wait for the official 0.8.2 release.

D.

Toxaris 11-26-2014 07:32 AM

Quote:

Originally Posted by Doitsu (Post 2985965)
Hi Kevin,


Actually, all the credit goes to Toxaris who found the bug in the first place.


Thanks for the kind offer, but I'm going to wait for the official 0.8.2 release.

D.

No problem, I am glad that it was on time! I only found out about it since I actually wanted an edit plugin instead of a output plugin.

I will hold up the release of the plugin now and wait for Sigil 0.8.2 for testing. I might build Sigil myself, as I have a windows development machine with VS2010, but I haven't gotten around to reading the build instructions yet.

KevinH 11-28-2014 07:54 PM

Hi Doitsu and Toxaris,
user-none has just released Sigil 0.8.2 which should now do what you need to get deletefile and your plugins going.

Please let me know if you still run into any issues.

Thanks,

KevinH

Doitsu 11-29-2014 04:07 AM

@KevinH: I did a quick test and it appears that bk.deletefile() now works as expected; it's also now possible to display print() messages while the plugin is running, which is very helpful for displaying status messages while processing a large number of files.

Thanks for your hard work. You've made the plugin interface even more useful. :thanks:

DiapDealer 11-29-2014 10:21 AM

Adding my thanks for the unbuffered output as well. That makes a big difference on the debugging side of things!

Toxaris 11-29-2014 12:35 PM

Quote:

Originally Posted by KevinH (Post 2988854)
Hi Doitsu and Toxaris,
user-none has just released Sigil 0.8.2 which should now do what you need to get deletefile and your plugins going.

Please let me know if you still run into any issues.

Thanks,

KevinH

Will do and if it works I can release it tonight!

crutledge 11-29-2014 03:59 PM

PunctuationSmarten
 
1 Attachment(s)
After installimg Sigil 8.1, I'm getting the following error from PunctuationSmarten.

Changes made to Text/East and West-Poems.htm
<?xml version="1.0" encoding="UTF-8"?>
<wrapper type="edit">
<result>success</result>
<changes>
<modified href="OEBPS/Text/East and West-Poems.htm" id="East_and_West-Poems.htm" media-type="application/xhtml+xml" />
</changes>
<msg>
Changes made to Text/East and West-Poems.htm
</msg>
</wrapper>

Doitsu 11-29-2014 04:32 PM

Quote:

Originally Posted by crutledge (Post 2989347)
After installimg Sigil 8.1, I'm getting the following error from PunctuationSmarten.

This usually only happens if invalid .html files are processed with plugins.
1. Did you check the epub with epubcheck before you ran the plugin?
2. Did you install PunctuationSmarten_v0.1.0.zip?

If you checked the epub with epubcheck (not FlightCrew) and installed PunctuationSmarten_v0.1.0.zip you'll need to attach an epub that generates this error.


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.