11-29-2014, 04:57 PM | #46 |
Sigil Developer
Posts: 8,160
Karma: 5450818
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 05:01 PM. |
11-29-2014, 06:07 PM | #47 | |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Quote:
|
|
Advert | |
|
11-29-2014, 06:55 PM | #48 |
Grand Sorcerer
Posts: 28,044
Karma: 199464182
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. |
11-30-2014, 03:41 AM | #49 |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
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. |
12-01-2014, 11:17 AM | #50 |
Wizard
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. |
Advert | |
|
12-01-2014, 03:35 PM | #51 |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
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? |
12-01-2014, 03:52 PM | #52 |
Wizard
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...
|
12-01-2014, 04:19 PM | #53 | ||
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
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:
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 |
||
12-01-2014, 04:49 PM | #54 |
Wizard
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.
|
12-01-2014, 06:36 PM | #55 |
Sigil Developer
Posts: 8,160
Karma: 5450818
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 06:39 PM. |
12-01-2014, 07:32 PM | #56 | ||
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Quote:
(The default Import statement didn't work when I copied the whole BS4 folder into the plugin folder.) |
||
12-01-2014, 08:09 PM | #57 | |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Quote:
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. Last edited by KevinH; 12-01-2014 at 10:17 PM. Reason: Added to examples one using modules and one using folders |
|
12-02-2014, 06:25 AM | #58 |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
|
12-03-2014, 07:05 AM | #59 |
Member
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.
|
12-03-2014, 07:12 AM | #60 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
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.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Loading Plugin in development | Sladd | Development | 6 | 06-17-2014 07:57 PM |
Question for plugin development gurus | DiapDealer | Plugins | 2 | 02-05-2012 12:33 AM |
DR800 Plugin development for DR800/DR1000 | yuri_b | iRex Developer's Corner | 0 | 09-18-2010 10:46 AM |
Device plugin development | reader42 | Plugins | 10 | 03-29-2010 01:39 PM |
Calibre plugin development - Newbie problems | minstrel | Plugins | 5 | 04-12-2009 01:44 PM |