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-22-2015, 04:03 PM   #151
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Same here, it works fine.

Are you sure you are testing sigil 0.9.2.r12.ga63067f?
eschwartz is offline   Reply With Quote
Old 12-22-2015, 04:11 PM   #152
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,735
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
Do you also have the following changes to launcher.py in your tree. See the end of the commit diff.
I don't have these changes, I guess I must have made a mistake getting the latest source files from Github.
I'll grab them again, create a new a build and report back.

EDIT: It's working now. I've attached a screenshot of the new plugin runner dialog box.

(If you click Details, it'll display the usual Plugin Runner dialog box.)
Attached Thumbnails
Click image for larger version

Name:	plugn_running.png
Views:	847
Size:	9.5 KB
ID:	144832  

Last edited by Doitsu; 12-22-2015 at 05:08 PM.
Doitsu is offline   Reply With Quote
Advert
Old 12-26-2015, 09:00 AM   #153
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Hi,

can i get the current active/marked xhtml file in the tree to insert a file with a plugin direct behind it?

//rubeus
rubeus is offline   Reply With Quote
Old 12-26-2015, 09:28 AM   #154
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,828
Karma: 6120478
Join Date: Nov 2009
Device: many
If the user has highlighted a file name in the BookBrowser window before launching your plugin, then your plugin can get the name of that file (in fact a list of all highlighted files), and it can use that info any way you want.

See the bk.selected_iter() function in the latest Plugin Framework Guide

KevinH

Quote:
Originally Posted by rubeus View Post
Hi,

can i get the current active/marked xhtml file in the tree to insert a file with a plugin direct behind it?

//rubeus
KevinH is offline   Reply With Quote
Old 01-03-2016, 11:00 AM   #155
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,828
Karma: 6120478
Join Date: Nov 2009
Device: many
Plugin Developer's Head's Up - new features

Hi All,

This is just to provide a head's up. Recent work, that will probably make it into the next release, has made epub3 editing in Sigil much more of an equal partner (at least for simple epub3 ebooks that stick to epub2 main features but done in html5).

Users will be provided with a new "General Settings" Preference window where they can set what epub version that would like all new documents to start with.

That means Mend(), splitting Files, adding existing files, index generation, ncx generation, and basic xhtml editing are now epub version aware and should not break epub3 ebooks by using the wrong doctypes and things. Also a new "Epub 3 Tools" submenu under Tools will be provided with epub3 specific tools such as "Updating Manifest Properties", and "Nav Generator".

For plugin Developers, that means starting with the next release, if your plugin was only designed to work with one type of epub due to assumptions about DOCTYPES or use of named entities and the like (epub3 only allows numeric entities) - you will need to be able to get the epub version of the ebook your plugin has been passed easily.

So we have added a new interface:

bk.epub_version()

It will return a unicode string indicating the package version attribute of the ebook being worked on by your plugin - typically returning "2.0" or "3.0".

For example, the epub3-itizer is designed to work only with valid epub2 ebooks. So my next version of the plugin will check for the required epub version and error out with a message if passed in an epub3.

The snippet of code to do that is provided as follows:

Code:
epubversion = "2.0"
if bk.launcher_version() >= 20160102:
    epubversion = bk.epub_version()

if epubversion.startswith("3"):
    print("Error: ePub3-itizer requires a valid Epub 2.0 ebook as input")
    return -1
So please look at your plugin code and see if it makes any assumptions or uses DOCTYPES and things that are epub 2 only. If so, consider either erroring out with a message similar to the code snippet above, or better yet ... us the bk.epub_version() call to properly set DOCTYPES, convert named entities to numeric entities, and things like that so that your plugin will work under both epub2 and epub3 ebooks without introducing any breakage.


Comments and questions welcome ...

KevinH

ps. If launcher_version < 20160102, it is safe to assume that you plugin has been passed an epub2 ebook for all intents and purposes.

pps. If people would like to see one approach to converted named entities to numeric entities, please check out the epub3-itizer code base which handles that.

Last edited by KevinH; 01-04-2016 at 09:31 AM. Reason: a few new updates
KevinH is offline   Reply With Quote
Advert
Old 01-06-2016, 03:08 PM   #156
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Running one of my plugins i noticed the plugin runner window was flickering a little bit. I was able to do a screen recording and captured this:



This is disappearing very fast. Am i doing something wrong or is there any way to fix this?

//rubeus
rubeus is offline   Reply With Quote
Old 01-06-2016, 03:55 PM   #157
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,635
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Fix what?
DiapDealer is offline   Reply With Quote
Old 01-06-2016, 04:28 PM   #158
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
That this message isn't displayed
rubeus is offline   Reply With Quote
Old 01-06-2016, 04:53 PM   #159
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,828
Karma: 6120478
Join Date: Nov 2009
Device: many
Depending on your version of Sigil, you should make sure you return a non-zero value to ensure the error log is shown (things written to stderr).

Also make sure you have not enabled the "autoclose" in the plugin.xml if you are using a build from master. If this is in a validation plugin, then reporting no errors will allow it to autoclose.

You are also seeing the result xml being sent back from the launcher.py code in the plugin framework back to Sigil. I am not sure how you are seeing this? What exact version of Sigil are you using?

KevinH

Last edited by KevinH; 01-06-2016 at 04:56 PM.
KevinH is offline   Reply With Quote
Old 01-06-2016, 05:10 PM   #160
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,635
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
I am not sure how you are seeing this? What exact version of Sigil are you using?
I see it on very slow machines sometimes, but it still goes away pretty quickly. I think he's recorded the screen and slowed it down to capture it. I'm just not sure why. The xml message being sent back to Sigil is not for user consumption.
DiapDealer is offline   Reply With Quote
Old 01-06-2016, 05:23 PM   #161
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,828
Karma: 6120478
Join Date: Nov 2009
Device: many
I will look into PluginRunner.cpp to see if there is a way to prevent the result xml from being seen at all.

KevinH
KevinH is offline   Reply With Quote
Old 01-07-2016, 01:58 AM   #162
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Hi,

i was capturing it cause it was unreadable. And what would you assume if you are testing a plugin producing output disappearing so fast it cant be read. Isnt it so far away to assume an erro in your plugin you wanna tear down? I had a look at it cause it was presented to me. And would an enduser thinks starting the plugin being aware of the same? Is it so hard to think about he might believe that the plugin went wrong and destroyed the epub. I'm tired reading those assumptions. They can only come from a developer not be able to change gus point of view. I think i need to take some break when asking here and getting such a response: Hey dude, this message isn't for you! Don't look at it!

By the way, a quadcore with 2.5 Ghz having nothing to do isnt really slow.....

@Kevin: When updateing a file with bk.writefile(id, soup.serialize_xhtml()) the screen with my messages disappears, then for a tenth of a second or may be two the xmls is presented. If you do this in loop writing back a lot of files the plugin launcher window starts to flicker. In my first assumption i thought this came from sigil_bs4 or PIL using the libs in a wrong way so i did a screen recording to find out what these messages are about.
rubeus is offline   Reply With Quote
Old 01-07-2016, 07:11 AM   #163
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,828
Karma: 6120478
Join Date: Nov 2009
Device: many
Hi rubeus,
I have never ever seen it on my Mac. Therefore, I did not know a user could ever see the result.xml file on screen (even briefly). You should always clearly see your output you wrote to stdout in the plugin and nothing else.

In other words, your "Scanning Text/coverpage.xhtml..." line with a status of Success should stay their until you close the dialog.

If your plugin returned an error or threw an uncaught exception, that screen would stay to help the plugin developer and Sigil developers to know what is wrong.

Right now, the Sigil console window shows everything written to stdout and stderror being sent back from the python process running the plugin. We do this in case of a hang or infinite loop.

Once it completes, the console window is reset to just stdout. In the brief instant before being reset you are seeing the result.xml file that Sigil uses to safely merge your changes back into the official directory holding the ebook being worked on.

I will modify the code to strip out any result.xml info but you still might see the console screen flicker once when it resets to show only stdout on success. That was how it was designed to work anyway, I had no idea the result.xml could ever be seen.

KevinH



Quote:
Originally Posted by rubeus View Post
Hi,

i was capturing it cause it was unreadable. And what would you assume if you are testing a plugin producing output disappearing so fast it cant be read. Isnt it so far away to assume an erro in your plugin you wanna tear down? I had a look at it cause it was presented to me. And would an enduser thinks starting the plugin being aware of the same? Is it so hard to think about he might believe that the plugin went wrong and destroyed the epub. I'm tired reading those assumptions. They can only come from a developer not be able to change gus point of view. I think i need to take some break when asking here and getting such a response: Hey dude, this message isn't for you! Don't look at it!

By the way, a quadcore with 2.5 Ghz having nothing to do isnt really slow.....

@Kevin: When updateing a file with bk.writefile(id, soup.serialize_xhtml()) the screen with my messages disappears, then for a tenth of a second or may be two the xmls is presented. If you do this in loop writing back a lot of files the plugin launcher window starts to flicker. In my first assumption i thought this came from sigil_bs4 or PIL using the libs in a wrong way so i did a screen recording to find out what these messages are about.
KevinH is offline   Reply With Quote
Old 01-07-2016, 07:46 AM   #164
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,828
Karma: 6120478
Join Date: Nov 2009
Device: many
Hi rubeus,
A fix is not easy. It seems the Plugin runner console window is updated asynchronously as the python plugin process outputs data. So it can be updated in small sets of bytes at a time. That makes looking for the xml result header to start stripping it out hard to do as it may come in as many different much smaller seemingly randomly generated pieces.

I will have to redesign the launcher code completely to do line buffering instead of asynchronous buffering so that I can search for the result xml info to strip it out before showing to the screen.

I will add it to my to-do list but right now there are other things higher priority.

Thanks for your bug report.

KevinH
KevinH is offline   Reply With Quote
Old 01-07-2016, 09:22 AM   #165
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Thats fine with me. So i know where it comes from now and its not my fault nor something from one of libs i used in the plugin.
rubeus is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading Plugin in development Sladd Development 6 06-17-2014 06:57 PM
Question for plugin development gurus DiapDealer Plugins 2 02-04-2012 11:33 PM
DR800 Plugin development for DR800/DR1000 yuri_b iRex Developer's Corner 0 09-18-2010 09:46 AM
Device plugin development reader42 Plugins 10 03-29-2010 12:39 PM
Calibre plugin development - Newbie problems minstrel Plugins 5 04-12-2009 12:44 PM


All times are GMT -4. The time now is 12:09 AM.


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