![]() |
#16 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
I think it is coming from the tempfile or from the plugin launcher outdir. Perhaps on Windows mkdtemp returns a unicode path? Or it could come from the unicode literal string for the name of the new epub 'new.epub'. Code:
@contextmanager def make_temp_directory(): import tempfile, shutil temp_dir = tempfile.mkdtemp() yield temp_dir shutil.rmtree(temp_dir) Code:
@contextmanager def make_temp_directory(): import tempfile, shutil from utf8_utils import utf8_str temp_dir = utf8_str(tempfile.mkdtemp()) yield temp_dir shutil.rmtree(temp_dir) The problem is all it takes is one full unicode path piece to exist and when joining paths to it, all of the resulting path will be upconverted to full unicode. So tracking down which is the culprit will take some time but I will find it. Perhaps simply removing the unicode literals and seeing what happens might be easiest as now I am wondering what happens with the following code: self.bk.addotherfile('new.epub', data) The 'new.epub" is a literal and so probably is full unicode. Then concatenating its name to the outdir path probably forces the whole thing to be full unicode. Thanks, KevinH Quote:
Last edited by KevinH; 09-09-2014 at 04:00 PM. |
|
![]() |
![]() |
#17 |
Connoisseur
![]() Posts: 81
Karma: 10
Join Date: Nov 2013
Device: Kobo Aura HD
|
[Suggestion] Multiple dictionaries
Hi,
first, thanks for continuing Sigil!!! ![]() I have two suggestions.
Thanks |
![]() |
Advert | |
|
![]() |
#18 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
Once I removed the from future unicode-literals from both mobi_stuff.py and KindleImport.py all warnings went away. When we built up the path to the epub using the literal 'mobi8' we were forcing the entire path to the new epub to be full unicode. So unless KindleImport.py and mobi_stuff.py actually need the from future unicode_literals stuff, can we remove them? When I build the python 3 interface, then I will move the python interfaces to be full unicode. Right now much of the launcher/wrapper code depends on the utf-8 strings much like KindleUnpack does. Thanks, Kevin |
![]() |
![]() |
#19 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,147
Karma: 144284184
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
#20 | ||
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Quote:
The only other way to deal with multiple dictionaries is to somehow allow the user to tag each and every word of text with the language that word is drawn from. That is very time consuming to do but is possible in both Word and OpenOffice/LibreOffice. You could possibly add span tags to somehow convey the language of the span, but this would have to be standardized to make multiple-language spell checking possible. Quote:
Take care, KevinH |
||
![]() |
Advert | |
|
![]() |
#21 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
|
|
![]() |
![]() |
#22 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
Given that Paul, DiapDealer, tkeo and myself are the primary authors of KindleUnpack and maintain it, I really don't think you need to worry about whether there are multiple versions needed or not. KevinH |
![]() |
![]() |
#23 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi Doitsu,
I did not know Sigil could do that. Wow! You really do learn something new every day! Thanks, KevinH Quote:
|
|
![]() |
![]() |
#24 | |
Connoisseur
![]() Posts: 81
Karma: 10
Join Date: Nov 2013
Device: Kobo Aura HD
|
Quote:
I was asking for a plugin to run all of them at the same time, and not load every one of them. ![]() |
|
![]() |
![]() |
#25 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Yep. They don't have to be there. I've just gotten in the habit of trying to keep my scripts as close to Python3-ready as I can. I think there's a couple of tweaks to some of the struct hex-string stuff in mobiHeaderLight and SectionerLight, but that's no big deal to fix. I'll take a peek later tonight/early tomorrow.
|
![]() |
![]() |
#26 |
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Ubuntu packages courtesy of DiapDealer have been uploaded.
|
![]() |
![]() |
#27 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Looks like John added my Linux binary packages to the available alpha downloads for those who want to play. Just use the link in his first post.
Packages are hard-coded to install to the /usr/local prefix and can be removed anytime using "sudo dpkg -r sigil". EDIT: Oops cross posted. ![]() Thanks for making those available, John. ![]() Last edited by DiapDealer; 09-09-2014 at 06:35 PM. |
![]() |
![]() |
#28 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Group them (indent) under a Group title: Ex I have a series of (6) searches for the CSS to rename NAMED font sizes to my EM sizing standards (assumes standard search box is open and set for mode and scope) I highlight the Group title in Saved Searches: click load search. click Replace All IN SAVED SEARCHES The whole series executes 1 after another ![]() |
|
![]() |
![]() |
#29 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi DiapDelaer,
The more I think about this the more I think you should not need to remove unicode_literals from the plugin. You are right, keeping your code as close to Python 3 as possible is a good idea. The bug has to either be in my launcher code or the kindleunpack code someplace since those are the only places pathof() are used. I've looked, and the first thing the bk.addotherfile does is run utf8_str() on the 'new.epub' passed in so that can't be it. The first thing the launcher does is use utf8_argv to get utf-8 encoded versions of all command line arguments such as the module name, the outdir, ebook_root etc so that can't be it either. And I checked and the first thing kindleunpack.py does in unpackBook is run utf8_str() on the infile and outdir paths. So I simply can not see how any unicode at all makes it past those utf8_str() calls and they should be the only interface points where full unicode can enter. So please leave in the unicode literals import and I will try to track down where exactly the unicode path pieces are getting past the screens that should allow it to work nicely with full unicode with no warnings whatsoever. Thanks, Kevin Quote:
|
|
![]() |
![]() |
#30 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Hey Kevin,
I'm finding some weird behavior with the plugin that I can't really explain (at least on Linux). Suffice to say that I think the full Tk mainloop approach may be introducing some unwanted issues. Once I select a file to process, I simply cannot programmatically stop the plugin (close/destroy the root window) based on certain criteria. It tries to unpack anything I feed it--even though I specifically tell it to jump to the quitApp function if a KF8 book isn't detected (and it does go to the quitApp function--it just also continues to try to unpack). Simply put: the only thing that seems to close the plugin's gui programmatically (once it gets to the doit function) is complete success. Puzzling. Last edited by DiapDealer; 09-10-2014 at 09:53 AM. |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Smashwords: direct epub upload in alpha testing | avantman42 | Writers' Corner | 15 | 01-01-2013 05:19 PM |
Android Xobni for Android coming soon - Sign up today for Alpha testing | guyjack | enTourage Archive | 4 | 04-09-2011 02:27 PM |
Alpha 700 = 8.9" 1024x600 LCD + E-Reader = $219 | Sonist | News | 31 | 03-22-2010 12:46 PM |
Book Designer iLiad module is ready for testing | vvv | iRex | 16 | 09-21-2006 12:57 PM |
So is the Iliad really production ready and is the market ready for e-readers? | pdam | iRex | 28 | 09-14-2006 05:24 PM |