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 01-02-2018, 05:45 PM   #121
KevinH
Wizard
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: 3,021
Karma: 1931746
Join Date: Nov 2009
Device: many
Note, filesystem/path encodings in Python can differ greatly on Windows from the utf-8 standard used on Linux and Macs.

So if you are trying to convert a bytestring in Python that contains a path or partial path to full unicode you should probably decode it using sys.getfilesystemencoding() to create a full unicode string and then encode that into utf-8 for printing.

Alternatively, you can use 'replace' with decode and encode routines to prevent problems with unknown bytestrings.

See my unipath.py code here for routines for fighting this battle:

https://github.com/Sigil-Ebook/Sigil...hon/unipath.py
KevinH is offline   Reply With Quote
Old 01-03-2018, 02:37 PM   #122
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,457
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Thanks Kevin, I will take a look of that. As my main platform is Windows (although currently I develop on Linux for Python), I would have never catched this.
Toxaris is offline   Reply With Quote
Old 01-03-2018, 03:07 PM   #123
KevinH
Wizard
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: 3,021
Karma: 1931746
Join Date: Nov 2009
Device: many
Python 3.6 has a new PEP 528 and PEP 529 that changes things for paths on Windows.

Windows is hard but Python 3.6 and sys.getfilesystemencoding() will fix most of this. The real problem for paths in Python is in Linux which can theoretically use arbitrary bytes sequences with no encoding at all inside file paths when the C-locale is set by the user forcing the use of surrogateescape to smuggle/hide these non-utf-8 byte sequences into utf-8 strings. But, of course these can not be printed either!

https://www.python.org/dev/peps/pep-0528/

https://www.python.org/dev/peps/pep-0529/
KevinH is offline   Reply With Quote
Old 04-13-2018, 02:00 PM   #124
big_smile
Junior Member
big_smile began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Apr 2018
Device: Kindle
Hope it's okay to bump this, but I am having an issue.

I have installed the latest Sigil on my Mac. I have also installed Mono Framework from here.

However, when I run ePub optimizer, I get the following error message:
Quote:
Status: failed

mono /Users/appleuser/Library/Application Support/sigil-ebook/sigil/plugins/ePUBOptimizer/ePUBOptimizer.exe /Users/appleuser/Library/Application Support/sigil-ebook/sigil/plugins/ePUBOptimizer/dummy.epub
Traceback (most recent call last):
File "/Applications/Sigil.app/Contents/plugin_launchers/python/launcher.py", line 135, in launch
self.exitcode = target_script.run(container)
File "/Users/appleuser/Library/Application Support/sigil-ebook/sigil/plugins/ePUBOptimizer/plugin.py", line 95, in run
result = OptiWrapper(*args)
File "/Users/appleuser/Library/Application Support/sigil-ebook/sigil/plugins/ePUBOptimizer/plugin.py", line 146, in OptiWrapper
process = Popen(list(args), stdout=PIPE, stderr=PIPE)
File "subprocess.py", line 947, in __init__
File "subprocess.py", line 1551, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'mono'
Error: [Errno 2] No such file or directory: 'mono'
I don't understand why it says no mono as I have installed the framework.

I am running Mac Os 10.13.4
big_smile is offline   Reply With Quote
Old 04-13-2018, 02:37 PM   #125
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: 18,592
Karma: 95833334
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It just can't find the mono binary for some reason.

At a guess (defer to Toxaris' advice if and when he responds), I'd say mono needs to be in the Path for the plugin to find it. Was there an option for adding Mono to the Path when installing it?

Last edited by DiapDealer; 04-13-2018 at 02:46 PM.
DiapDealer is offline   Reply With Quote
Old 04-13-2018, 03:38 PM   #126
Doitsu
Wizard
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: 4,224
Karma: 13659369
Join Date: Dec 2010
Device: Kindle PW2
@big_smile: If you've Calibre installed on your Mac, you can also use Polish Books. (It also uses cjpeg, jpegtran and optipng for lossless image compression.)

@DiapDealer: Even though I have Mono installed on my Arch Linux machine I never could get the plugin to work. Does it work on your Linux machine?
Doitsu is offline   Reply With Quote
Old 04-14-2018, 06:13 AM   #127
big_smile
Junior Member
big_smile began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Apr 2018
Device: Kindle
Quote:
Originally Posted by Doitsu View Post
@big_smile: If you've Calibre installed on your Mac, you can also use Polish Books. (It also uses cjpeg, jpegtran and optipng for lossless image compression.)
Thanks, I'll give a try!
Does it do all the shrinking to ebooks that ePUB Optimizer does?

Quote:
Originally Posted by DiapDealer View Post
It just can't find the mono binary for some reason.

At a guess (defer to Toxaris' advice if and when he responds), I'd say mono needs to be in the Path for the plugin to find it. Was there an option for adding Mono to the Path when installing it?
No, it didn't give an option. Do you know which path it should be in? Maybe I can move it manually. Thanks for your help!
big_smile is offline   Reply With Quote
Old 04-14-2018, 07:35 AM   #128
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: 18,592
Karma: 95833334
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
@DiapDealer: Even though I have Mono installed on my Arch Linux machine I never could get the plugin to work. Does it work on your Linux machine?
I've never tried. I was just giving some quick advice as to what sounded reasonable. I just sort of assumed the plugin had been vetted on a Mac.
DiapDealer is offline   Reply With Quote
Old 04-14-2018, 07:49 AM   #129
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 52,294
Karma: 47192023
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
OS X 10.13.4 will only run 64-bit software. That means that if anything in Sigil relies on 32-bit code, it won't work. So that means even Python has to be 64-bit.
JSWolf is offline   Reply With Quote
Old 04-14-2018, 08:35 AM   #130
KevinH
Wizard
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: 3,021
Karma: 1931746
Join Date: Nov 2009
Device: many
No, 32 bit software still runs fine in OSX with the latest update. It will just warn you that with the next major update it will not.

On OSX, python is embedded in Sigil and everything already is 64 bit and has been for years.
KevinH is offline   Reply With Quote
Old 04-14-2018, 01:51 PM   #131
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,457
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
The plugin will not search for mono. It should be in the path so it can be called directly. Open an command prompt and just run mono to see if it is in the path. If not, you could try 'which mono' to see if you can find a path and adapt that yourself in the plugin call.

If you don't use fonts in your ePUB, Polish Ebooks will do the same.
Toxaris is offline   Reply With Quote
Old 04-14-2018, 02:48 PM   #132
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: 18,592
Karma: 95833334
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
@DiapDealer: Even though I have Mono installed on my Arch Linux machine I never could get the plugin to work. Does it work on your Linux machine?
I got it working, yes.

In addition to mono, you need to install the VisualBasic.Net interpreter: mono-basic from the AUR.

Make sure you run:

Code:
export TERM=xterm
before trying to build mono-basic (as per the latest comments).

After that, the plugin completed successfully. I didn't try it on anything but the simple, default empty plugin, but there were no errors. Hope that helps Arch users.

EDIT: and of course; libjpeg-turbo, optipng, and gifsicle for the image stuff

Last edited by DiapDealer; 04-14-2018 at 02:55 PM.
DiapDealer is offline   Reply With Quote
Old 04-14-2018, 03:02 PM   #133
Doitsu
Wizard
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: 4,224
Karma: 13659369
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
In addition to mono, you need to install the VisualBasic.Net interpreter: mono-basic from the AUR.
Thanks for your research! After installing mono-basic the plugin worked fine.
Doitsu 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
Comic optimizer script rhon Kobo Reader 0 11-08-2012 06:04 PM
Mokle - Mangas Optimizer for Kindle devorez Kindle Developer's Corner 11 08-14-2012 07:15 PM
Patent/Heavy graphics pdfs and Adobe PDF Optimizer andrewscheinman iRex 4 12-26-2009 11:39 AM
epub, ePub, EPUB, warum blos ePub? flowoeB Lounge 5 11-27-2009 09:37 AM
PRS-500 PDF file optimizer phigdon Sony Reader Dev Corner 1 04-01-2007 11:40 PM


All times are GMT -4. The time now is 02:54 AM.


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