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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-10-2013, 11:37 AM   #196
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,870
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by anacreon View Post
I downloaded the "open with" plugin, but I get error messages. I corrected the Sigil path then retried, with several epubs from different sources, same thing.

Spoiler:
calibre, version 1.2.0
ERREUR : Exception non gérée: <b>UnicodeDecodeError</b>:'utf8' codec can't decode byte 0xc3 in position 0: unexpected end of data

calibre 1.2 [64bit] isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.4
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
File "calibre_plugins.open_with.action", line 178, in open_with
File "calibre_plugins.open_with.action", line 212, in launch_app
File "subprocess.py", line 711, in __init__
File "subprocess.py", line 907, in _execute_child
File "subprocess.py", line 646, in list2cmdline
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 0: unexpected end of data

I skimmed through the 16 pages of the thread, and there might be an answer, but I have no notion of python and such. I have Windows 7 64bits, calibre 1.2 and Sigil 0.7.2.
FWIW Sigil is at 7.3 and works on W7 64

The message indicates a unicode decode problem.
Try with an English only filename as a test
theducks is online now   Reply With Quote
Old 09-10-2013, 02:39 PM   #197
anacreon
Groupie
anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.anacreon can really shake a tail feather.
 
anacreon's Avatar
 
Posts: 183
Karma: 116540
Join Date: May 2012
Location: France
Device: sony prs-t2, aura 6" + h2o
I downloaded the 7.3 Sigil, and tried it with another English book (I think this morning's was English too), similar problem:

Spoiler:
calibre, version 1.2.0
ERREUR : Exception non gérée: <b>UnicodeDecodeError</b>:'utf8' codec can't decode byte 0xc3 in position 0: unexpected end of data

calibre 1.2 [64bit] isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.4
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
File "calibre_plugins.open_with.action", line 178, in open_with
File "calibre_plugins.open_with.action", line 212, in launch_app
File "subprocess.py", line 711, in __init__
File "subprocess.py", line 907, in _execute_child
File "subprocess.py", line 646, in list2cmdline
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 0: unexpected end of data


PS: What is FWIW an acronym for? I knew only FYI.
anacreon is offline   Reply With Quote
 
Enthusiast
Old 09-10-2013, 02:43 PM   #198
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,992
Karma: 44005669
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
For What Its Worth.
PeterT is offline   Reply With Quote
Old 09-21-2013, 05:29 PM   #199
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,719
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
@kiwidude -

UPDATE - Ignore this whole question. I misunderstood Kovid, he's adding what I wanted to calibre's eject feature directly, so I don't need to call anything.

I don't know if you've been following this thread, Nook STRg doesn't eject completely?, but Kovid was kind enough to make a utility program for the next version that unmounts usb devices before ejecting them.

My intention is to make my SmartEject PI (configurably) call it.

Rather than reinvent the wheel, would you mind if I had SmartEject call Open With, since it already knows how to run programs on all the OSes? Something like:
Code:
ow_plugin = self.gui.iactions['Open With']
ow_plugin.launch_app("path_to_install\calibre-eject.exe","g h i","")
Except with configurable values, of course.

Initial testing seems like it works fine.

Last edited by JimmXinu; 09-21-2013 at 11:00 PM. Reason: Correct code snippet.
JimmXinu is offline   Reply With Quote
Old 09-21-2013, 06:03 PM   #200
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,719
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Quote:
Originally Posted by JimmXinu View Post
Initial testing seems like it works fine.
Except not really.

calibre-eject chokes on the empty parameter from the empty path_to_file.

And changing launch_app to work without path_to_file would require changes to all three OS paths, so I'll understand if you don't want to do that.
JimmXinu is offline   Reply With Quote
Old 09-21-2013, 06:47 PM   #201
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,719
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Just in case you are interested, here's a modified version of launch_app(). I've only tested it with windows.
Spoiler:
Code:
    def launch_app(self, external_app_path, app_args, path_to_file=None):
        external_app_path = os.path.expandvars(external_app_path)
        if path_to_file != None:
            path_to_file = path_to_file.encode('utf-8')
        if DEBUG:
            print('Open: ', external_app_path, '(file): ', path_to_file, ' (args): ', app_args)

        if isosx:
            # For OSX we will not support optional command line arguments currently
            if external_app_path.lower().endswith(".app"):
                args = 'open -a '
            else:
                args = ''
            args += '"%s"' % external_app_path
            if path_to_file != None:
                args += ' "%s"' % path_to_file
            subprocess.Popen(args, shell=True)

        else:
            # For Windows/Linux merge any optional command line args with the app/file paths
            app_args_list = []
            if app_args:
                app_args_list = app_args.split(',')
            app_args_list.insert(0, external_app_path)
            if path_to_file != None:
                app_args_list.append(path_to_file)
            if iswindows:
                if path_to_file != None:
                    # Add to the recently opened files list to support windows jump lists etc.
                    from win32com.shell import shell, shellcon
                    shell.SHAddToRecentDocs(shellcon.SHARD_PATHA, path_to_file)
                # As of v1.5.3 will no longer use subprocess because it does not work
                # for users who have non-ascii library paths
                # However we need a special case for Sigil which has issues with C runtime paths
                DETACHED_PROCESS = 0x00000008
                if external_app_path.lower().endswith('sigil.exe'):
                    clean_env = dict(os.environ)
                    del clean_env['PATH']
                    subprocess.Popen(app_args_list, creationflags=DETACHED_PROCESS, env=clean_env)
                else:
                    from win32process import CreateProcess, STARTUPINFO
                    import _subprocess
                    cmd_line = '"%s"'%app_args_list[0]
                    for app_arg in app_args_list[1:]:
                        cmd_line += ' "%s"'%app_arg
                    si = STARTUPINFO()
                    si.dwFlags |= _subprocess.STARTF_USESTDHANDLES
                    print("OW cmd_line:%s"%cmd_line)
                    CreateProcess(None, cmd_line, None, None, False, DETACHED_PROCESS, None, None, si)

            else: #Linux
                clean_env = dict(os.environ)
                clean_env['LD_LIBRARY_PATH'] = ''
                subprocess.Popen(app_args_list, env=clean_env)
JimmXinu is offline   Reply With Quote
Old 09-21-2013, 10:59 PM   #202
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,719
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
@kiwidude - Ignore this whole question. I misunderstood Kovid, he's adding what I wanted to calibre's eject feature directly, so I don't need to call anything.
JimmXinu is offline   Reply With Quote
Old 09-22-2013, 05:37 AM   #203
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,228
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
No worries, ignore is default mode at moment unless a bug due to lack of time
kiwidude is offline   Reply With Quote
Old 10-22-2013, 07:40 PM   #204
At_Libitum
Addict
At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.
 
Posts: 266
Karma: 724240
Join Date: Aug 2013
Device: KyBook
I did search the topic if it was asked but either I chose the wrong search or it's not yet asked.

I see on the menu that it is capable of detecting which items are applicable in a given presence of formats for a book.

I would like to suggest an enhancement if this is possible.

On the configuration dialog, allow us to mark an entry as the default if more than one program is configured to open a specific format, and then on left click on the plugin icon, launch that entry.

e.g. I have a book with an additional .djvu format. WinDjView on the pen drive, and left click would then open WinDjView...(no file associations on portables)

I realize that if multiple formats are present, it would be up to the user to select which is the preferred one, and that there can only be one, as in such cases a choice would need to be made which format is the preferred. That is if there is a combination of multiple formats. If there is only one candidate activated then just launch whatever is the enabled menu entry.

And since epub seems to work from the details panel even without file associations, I am trying to find a way to do same with the non-epub formats, or at least those the built-in viewer can't handle. Since the details panel requires associations for these I was hoping perhaps via Open With would be an option

Last edited by At_Libitum; 10-22-2013 at 07:47 PM.
At_Libitum is offline   Reply With Quote
Old 10-26-2013, 08:08 AM   #205
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,228
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
@At_Libitum - its an interesting idea, and not something I can see any major flaws in that you haven't mentioned (other than lack of time at the moment to implement it). I confess to just using keyboard shortcuts to launch applications - you might consider that as a more flexible option as it gets around the multiple formats issue.
kiwidude is offline   Reply With Quote
Old 11-28-2013, 11:42 PM   #206
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,992
Karma: 44005669
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
Kiwi; you might be interested in bug 1256198 which seems to indicate a cause for the sporadic reports from calibre on startup of
Quote:
ERROR: Problem starting the wireless device: The wireless device driver did not start. It said "Failed to connect to port 9090. Try a different value.
PeterT is offline   Reply With Quote
Old 01-23-2014, 06:49 PM   #207
sengian
Zealot
sengian doesn't littersengian doesn't litter
 
sengian's Avatar
 
Posts: 104
Karma: 132
Join Date: Jul 2010
Location: Roubaix, France
Device: PRS-T1;PRS-650;PocketBook Touch Lux 2
Translation

A plugin modification adding translation of the plugin (general pot and french done).
Not extensively tested, for review and test.

EDIT: 19/07/2014 Port to Qt5 (davidfor modifications included)
Attached Files
File Type: rar Translations.rar (7.6 KB, 20 views)
File Type: zip Open with.zip (109.3 KB, 12 views)

Last edited by sengian; 07-19-2014 at 06:44 AM.
sengian is offline   Reply With Quote
Old 03-14-2014, 08:56 PM   #208
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,870
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Broken in Calibre 1.28 x64

I just went to use Openwith (Sigil) PI which has been solid thru 1.27.

I can still run Sigil. Tap 'O', Use the Windows context manager to "Open with Sigil"

Spoiler:
calibre, version 1.28.0
ERROR: Unhandled exception: <b>WindowsError</b>:[Error 2] The system cannot find the file specified

calibre 1.28 [64bit] Portable isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.5
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
File "calibre_plugins.open_with.action", line 178, in open_with
File "calibre_plugins.open_with.action", line 212, in launch_app
File "subprocess.py", line 711, in __init__
File "subprocess.py", line 948, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
theducks is online now   Reply With Quote
Old 03-14-2014, 09:23 PM   #209
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 3,625
Karma: 2183656
Join Date: Mar 2012
Location: NSW Australia
Device: none
Quote:
Originally Posted by theducks View Post
I just went to use Openwith (Sigil) PI which has been solid thru 1.27.

I can still run Sigil. Tap 'O', Use the Windows context manager to "Open with Sigil"

Spoiler:
calibre, version 1.28.0
ERROR: Unhandled exception: <b>WindowsError</b>:[Error 2] The system cannot find the file specified

calibre 1.28 [64bit] Portable isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.5
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
File "calibre_plugins.open_with.action", line 178, in open_with
File "calibre_plugins.open_with.action", line 212, in launch_app
File "subprocess.py", line 711, in __init__
File "subprocess.py", line 948, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
@theducks - Open With Sigil working OK here

Win7-SP1, calibre 64bit 1.28, Sigil Windows build 0.7.4

Pity it doesn't tell us which file it can't find

BR
BetterRed is online now   Reply With Quote
Old 03-14-2014, 09:50 PM   #210
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,870
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by BetterRed View Post
@theducks - Open With Sigil working OK here

Win7-SP1, calibre 64bit 1.28, Sigil Windows build 0.7.4

Pity it doesn't tell us which file it can't find

BR
First callback line # Confirm we have defined an application for that format in tweaks


The second line must be part of Calibre.

OK all Openwiths are failing
I have restarted Calibre.
The timestamp on Open With.json is 12/7/2013
Note the SPACE in the JSON file name
Almost all the JSON's associated with PI's have a space
theducks is online now   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
[GUI Plugin] Search the Internet kiwidude Plugins 205 08-11-2014 02:22 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM
Gui confusements. brewt Calibre 8 12-30-2008 12:16 PM
Reference Open eBook Forum: Open eBook Publication Structure. IMP. V1.0.1 14 September 2007 DaleDe IMP Books 0 09-14-2007 05:06 PM
iLiad GUI for the iLiad tribble iRex Developer's Corner 1 06-01-2007 02:29 PM


All times are GMT -4. The time now is 07:11 PM.


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