Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-29-2014, 03:57 PM   #46
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,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Hi,
Also make sure you are using Sigil 8.2 instead of 8.1. That error might be generated by using Sigil 0.8.1 but with the python launcher files from 0.8.2. So please verify you have installed Sigil0.8.2 properly and are running that version.

Kevin

Last edited by KevinH; 11-29-2014 at 04:01 PM.
KevinH is online now   Reply With Quote
Old 11-29-2014, 05:07 PM   #47
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by Doitsu View Post
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.
What is epubcheck and where do I find it?
Attached Files
File Type: epub Drift from Two Shores.epub (657.3 KB, 838 views)
crutledge is offline   Reply With Quote
Advert
Old 11-29-2014, 05:55 PM   #48
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,463
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It definitely sounds like you're using some of the updated plugin launcher files with Sigil v0.8.1.

I just checked and the plugin will work with a stock version of Sigil 0.8.1 or a stock version of 0.8.2.

If you updated some of those launcher files (as bug fixes were coming out), you should probably just update to a stock version of Sigil 0.8.2.

The released version of the plugin worked OK for me on your attached epub using Sigil 0.8.2.
DiapDealer is online now   Reply With Quote
Old 11-30-2014, 02:41 AM   #49
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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by crutledge View Post
What is epubcheck and where do I find it?
It's the official ePub validator. It's available:

a) online

b) as a drag & drop Java app.

c) as a Sigil plugin

Note that thanks to the new Validation plugin feature in 0.8.2 the next version of the epubcheck plugin will behave like FlightCrew. I.e. you'll be able to click on an error message to display the line that the error refers to.

BTW, I also tested DiapDealer's plugin with the stock 0.8.1 and 0.8.2 versions and didn't have any problems.
Doitsu is offline   Reply With Quote
Old 12-01-2014, 10:17 AM   #50
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
I get more feedback on Linux than on Windows. The plugin kicks of a program and that program subsequently fires other programs. The output from those programs are hidden and not displayed anywhere. The program does not report that output back.
On Linux however I also get the output from those programs, but not on Windows.
Toxaris is offline   Reply With Quote
Advert
Old 12-01-2014, 02:35 PM   #51
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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Question Javascript wrapper

@KevinH & user_none:

IMHO, Javascript would be the perfect embedded scripting language for Sigil, because it has been designed for website manipulation and the Qt Quick library already has JavaScript support.
Like Python it's cross-platform, relatively easy to learn, but unlike Python it doesn't require a separate HTML parser, which makes it perfect for HTML file manipulation.
Unlike the Python wrapper, which was designed to manipulate all parts of an epub, a hypothetical JavaScript wrapper would only need an HTML file iterator and the JavaScript equivalents of bk.readfile() and bk.writefile() to be useful.

Of course, since I'm not a programmer I have no idea how much work this would involve or whether this would be feasible at all.

Have you guys ever considered embedding a JavaScript interpreter?
Doitsu is offline   Reply With Quote
Old 12-01-2014, 02:52 PM   #52
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Not being a Python programmer myself, I find it workable enough. Much better understandable than JavaScript anyway. The main irritation factor with Python is the indention however, but I think that just needs getting used too...
Toxaris is offline   Reply With Quote
Old 12-01-2014, 03:19 PM   #53
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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Toxaris View Post
Not being a Python programmer myself, I find it workable enough.
I really like Python, but if you want to do some serious HTML parsing, you'll need to use external libraries such as Beautiful Soup. The older version, BS3, can be embedded, but the current version, BS4 is no longer embeddable.
You can do pretty much all that BS does with JavaScript without external libraries. (Python also has DOM manipulation libraries but unlike BS they can't handle Unicode.)
Quote:
Originally Posted by Toxaris View Post
The main irritation factor with Python is the indention however, but I think that just needs getting used too...
Initially, I found it annoying, too, but you get used to it and it forces you to write structured code.
There are other things that I find much more illogical. For example, string slicing parameters:

Code:
word = 'Python' 
print word[0:2]
# prints Py not Pyt
Doitsu is offline   Reply With Quote
Old 12-01-2014, 03:49 PM   #54
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
I am used to using additional libraries though... For HTML handling I use HTML Agility Pack, which is quite good but has some quirks. It was always my intent to learn more about Python, but I didn't have a good excuse. Of course I only have done baby steps so far.
Toxaris is offline   Reply With Quote
Old 12-01-2014, 05:36 PM   #55
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,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Hi,

Some points:

- Even Javascript requires a dom parser of some sort. Since javascript is typically embedded inside web pages, this is typically provided for it, not inherent. Something must create the dom it is wrapped around.

- BS4 is embeddable quite easily and will probably become part of the python 3 future of Sigil. Also embeddable quite easily is html5lib. Under python 3 built-in dom and xpath routines are quite powerful and fully unicode aware.

- most dom implementations like etree can easily be built from any tokenizer/parser including the built in quickparser.py support or html5lib or ... This is in fact what both BS3 and BS4 does.

So the real reason python was chosen over other languages for the first interface was that it is simple to learn, extremely powerful, easy to extend, and that has a ready flexible set of xml/xhtml processing libraries built in or easily addable.

Hope this helps,

KevinH

Last edited by KevinH; 12-01-2014 at 05:39 PM.
KevinH is online now   Reply With Quote
Old 12-01-2014, 06:32 PM   #56
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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
- Even Javascript requires a dom parser of some sort. Since javascript is typically embedded inside web pages, this is typically provided for it, not inherent. Something must create the dom it is wrapped around.
I didn't know this. Thanks for your detailed explanation.

Quote:
Originally Posted by KevinH View Post
- BS4 is embeddable quite easily and will probably become part of the python 3 future of Sigil. Also embeddable quite easily is html5lib. Under python 3 built-in dom and xpath routines are quite powerful and fully unicode aware.
BS3 is easily embeddable in a plugin, because it's a single Python file, but BS4 installs a folder. Is there any Python tool that'll "flatten" that folder into a single Python file or will I need to change the Import statement after copying the complete BS4 folder into the folder of the plugin?
(The default Import statement didn't work when I copied the whole BS4 folder into the plugin folder.)
Doitsu is offline   Reply With Quote
Old 12-01-2014, 07:09 PM   #57
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,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Doitsu View Post
BS3 is easily embeddable in a plugin, because it's a single Python file, but BS4 installs a folder. Is there any Python tool that'll "flatten" that folder into a single Python file or will I need to change the Import statement after copying the complete BS4 folder into the folder of the plugin?
(The default Import statement didn't work when I copied the whole BS4 folder into the plugin folder.)
There are a number of ways to handle it. You can manually add the subdirectory to sys.path so that a normal import will find it or alternatively you can use module based relative paths for importing it. The same is true for libgui as well.

I have added two different ways to import from a subdirectory either as a folder or as a module. See libgui_as_folder_example.zip and libgui_as_module_example.zip.

Notice the differences in test.py for how you add to the path or do the module based import. Also look at the differences in libgui as module that has its own __init__.py and uses relative addressing to import from .askfolder and .user_utilities, versus the libgui as folder example with no __init__.py and that relies on the sys.path search being done to find its imports.

Take care,

KevinH

ps. please note that for BS4 to work crossplatform as pure python, it is probably a good idea to include html5lib as well to get a pure python parser/tokenizer to inside BS4. Together, these will work on all platforms, and make embedding of BS4 quite easy.
Attached Files
File Type: zip libgui_as_folder_example.zip (7.8 KB, 517 views)
File Type: zip libgui_as_module_example.zip (8.0 KB, 505 views)

Last edited by KevinH; 12-01-2014 at 09:17 PM. Reason: Added to examples one using modules and one using folders
KevinH is online now   Reply With Quote
Old 12-02-2014, 05:25 AM   #58
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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
I have added two different ways to import from a subdirectory either as a folder or as a module. See libgui_as_folder_example.zip and libgui_as_module_example.zip.
Thanks for your examples. I've finally figured out how to embed BS4.
Doitsu is offline   Reply With Quote
Old 12-03-2014, 06:05 AM   #59
turbulent
Member
turbulent began at the beginning.
 
Posts: 14
Karma: 10
Join Date: May 2014
Device: kindle paperwhite
In an output sigil plugin, is it possible to get the file name of the epub file currently opened by sigil? So it's convinient to name the generated file after the epub file.
turbulent is offline   Reply With Quote
Old 12-03-2014, 06:12 AM   #60
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by turbulent View Post
In an output sigil plugin, is it possible to get the file name of the epub file currently opened by sigil? So it's convinient to name the generated file after the epub file.
Not that I can recall. It would be of limited use anyway, since it cannot be used as name to save the output. Reason is simple, as the file is still open within Sigil.
Toxaris is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:30 AM.


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