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-19-2015, 11:35 PM   #121
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: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Also, note that it is now important to rely on the plugin launcher's recorded preferences dir, since Sigil 0.9.2 has the ability to relocate the preferences dir via an environment variable.

I have mentioned that at portableapps.com so hopefully they will be using that once they publish a portable Sigil 0.9.2
eschwartz is offline   Reply With Quote
Old 12-20-2015, 06:41 AM   #122
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: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by eschwartz View Post
Also, note that it is now important to rely on the plugin launcher's recorded preferences dir, since Sigil 0.9.2 has the ability to relocate the preferences dir via an environment variable.
Very good point. I don't know of any plugins that really utilize a "hackish" method of determining the prefs directory, but if there are ... they should probably think about switching to the discussed method. But in reality, any method that computes the path to the preferences directory as a parent directory of the current running plugin's location should still be OK. the plugins are IN the prefs directory, afterall.

Last edited by DiapDealer; 12-21-2015 at 06:19 PM.
DiapDealer is online now   Reply With Quote
Advert
Old 12-20-2015, 11:08 AM   #123
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: 7,733
Karma: 5444398
Join Date: Nov 2009
Device: many
Head's Up for Plugin Developers: autostart capability for plugins being added

This is a head's up for all plugin developers. In my dev tree I have made changes to support the following new plugin.xml tag.

Code:
<autostart>true</autostart>
If this tag is found in your plugin.xml, Sigil will automatically do the equivalent of hitting the start button for the user when your plugin is launched. If it is set to false or is not found at all, the current behaviour is utilized - in other words the user will have to manually hit the Start button.

Therefore this change should be completely backwards compatible and my plan is to add it for the next release of Sigil unless there is no interest from plugin developers.

Also, if there is interest from plugin developers, I could also add an:

Code:
<autoclose>true</autoclose>
tag to the plugin.xml that will automatically close the plugin dialog if and only if the return value from the plugin is 0.

Please let me know what you think of the autostart capability and if you would like an autoclose tag as well.

Thanks,

KevinH
KevinH is offline   Reply With Quote
Old 12-20-2015, 11:16 AM   #124
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
I would appreciate both
rubeus is offline   Reply With Quote
Old 12-20-2015, 11:45 AM   #125
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,607
Karma: 23185369
Join Date: Dec 2010
Device: Kindle PW2
Both would be extremely helpful for validation plugins.
Doitsu is offline   Reply With Quote
Advert
Old 12-20-2015, 12:00 PM   #126
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: 7,733
Karma: 5444398
Join Date: Nov 2009
Device: many
Hi Doitsu,

Validation plugins that report no errors (return an error value of 0 from run()) should already autoclose.

That said, I went and added support for autoclose to my tree as well.

If anyone builds their own, grab master today and you should have both for testing with.

Take care,

KevinH

Quote:
Originally Posted by Doitsu View Post
Both would be extremely helpful for validation plugins.
KevinH is offline   Reply With Quote
Old 12-20-2015, 01:26 PM   #127
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: 27,602
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
That's quite lovely, thanks!
DiapDealer is online now   Reply With Quote
Old 12-20-2015, 02:36 PM   #128
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
I'm adding a file with

Code:
bk.addfile(uid, basename, data, mt)
but its missing in the spine What am i doing false?

Last edited by rubeus; 12-20-2015 at 02:40 PM.
rubeus is offline   Reply With Quote
Old 12-20-2015, 02:47 PM   #129
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: 7,733
Karma: 5444398
Join Date: Nov 2009
Device: many
You have to add it to the spine. You can add many file types that should not be added directly to the spine.
KevinH is offline   Reply With Quote
Old 12-20-2015, 03:09 PM   #130
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
Quote:
Originally Posted by KevinH View Post
You have to add it to the spine. You can add many file types that should not be added directly to the spine.
Ok, when i use

Code:
bk._w.spine.append((uid, None))
i get

Code:
Traceback (most recent call last):

  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 301, in <module>

    sys.exit(main())
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 268, in main
    ps.launch()
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 149, in launch

    container._w.write_opf()
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 268, in write_opf
    data = utf8_str(self.build_opf())
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 256, in build_opf

    data.append(self.build_spine_xml())
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 230, in build_spine_xml
    for (id, linear, properties) in self.spine:
ValueError: need more than 2 values to unpack
rubeus is offline   Reply With Quote
Old 12-20-2015, 03:13 PM   #131
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: 7,733
Karma: 5444398
Join Date: Nov 2009
Device: many
No, you should not use calls to the wrapper directly. ie. not bk._w ...

The correct call is direct to the bk object. See the bookcontainer.py code in the developers manual.

bk.spine_insert_before(pos, sid, linear, properties=None)

If you set the position, pos, to -1 or something greater than the number of current spine entries, it will append it to the end of the current spine.

Last edited by KevinH; 12-20-2015 at 03:23 PM.
KevinH is offline   Reply With Quote
Old 12-20-2015, 03:26 PM   #132
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
Sorry i'm to dumb for that, what is linear?

Code:
bk.spine_insert_before(-1, uid, linear, properties=None)
inserts the file, but then some lines appear in the launcher and disappears to fast to be read and the spine entry isnt present

Last edited by rubeus; 12-20-2015 at 03:32 PM.
rubeus is offline   Reply With Quote
Old 12-20-2015, 03:32 PM   #133
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: 7,733
Karma: 5444398
Join Date: Nov 2009
Device: many
That is the spine itemref linear attribute. You can set it to None for default.
According to the spec, it determines if the referenced content is "primary" or not. It takes values "yes", "no", and can be left out entirely by setting it to None which then defaults to "yes".

Last edited by KevinH; 12-20-2015 at 03:39 PM.
KevinH is offline   Reply With Quote
Old 12-20-2015, 03:41 PM   #134
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: 7,733
Karma: 5444398
Join Date: Nov 2009
Device: many
I will test this from my end and get back to you soon.

KevinH
KevinH is offline   Reply With Quote
Old 12-20-2015, 03:52 PM   #135
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
Quote:
Originally Posted by KevinH View Post
That is the spine itemref linear attribute. You can set it to None for default.
According to the spec, it determines if the referenced content is "primary" or not. It takes values "yes", "no", and can be left out entirely by setting it to None which then defaults to "yes".
Sorry, but i cant get this working.

Code:
    uid = 'T12345' 
    bk.addfile(uid, 'Test0001.xhtml', xml, 'application/xhtml+xml')
    bk.spine_insert_before(-1, uid, None, properties=None)
Code:
Traceback (most recent call last):

  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 301, in <module>

    sys.exit(main())
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 268, in main

    ps.launch()
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 149, in launch
    container._w.write_opf()
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 268, in write_opf
    data = utf8_str(self.build_opf())
  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 256, in build_opf

    data.append(self.build_spine_xml())

  File "C:\Program Files\Sigil\plugin_launchers\python\wrapper.py", line 230, in build_spine_xml
    for (id, linear, properties) in self.spine:
TypeError: 'NoneType' object is not iterable
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 06:41 AM.


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