02-10-2011, 10:22 AM | #1 |
Connoisseur
Posts: 80
Karma: 12933
Join Date: Feb 2011
Device: Galaxy Note 8, Sony PRS-650, Sony PRS-600
|
[GUI Plugin] Manage Sony x50 Reader Book List
I've decided to take a shot at developing a Calibre plugin, so I've put one together to help manage the Book list on the Sony x50 reader Home screen. The default Sony behaviour is to display the 3 most recently loaded books, but I'd like to have more control in what books show up there.
Incidentally, there is a standalone application that enables this as well that has been posted in the Sony Reader forum (https://www.mobileread.com/forums/sho...d.php?t=107826), and the application is excellent. However, I wanted to have something that is integrated with Calibre, and I also wanted to extend the functionality specific to my use cases. If anyone is interested in this functionality, I've put together a simple User Guide with installation, usage, and configuration information, as well as a description of the main use cases that I was trying to address. I've attached that below in both EPUB and PDF format, but I will repeat some of the information here for convenience. Main Features
Version History Spoiler:
Installation
Configuration and Usage
Known (or Potential) Issues Spoiler:
A Note on Testing Spoiler:
Under the Covers Spoiler:
Thanks all. Karl Last edited by kpw; 09-30-2014 at 08:37 PM. Reason: Update to version 1.2.10 |
02-10-2011, 09:42 PM | #2 |
Calibre Plugins Developer
Posts: 4,678
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Thanks for that - I don't own a Sony reader myself but I am sure others will appreciate the effort particularly with so much work on the documentation etc. I will add this to the plugins index sticky thread shortly.
I haven't looked at the code in detail, but I did notice (as per your comment) your usage of lots of classes at the module level with imports of Qt code etc. That is one of those "best not to do that" situations for various reasons according to Kovid when I got him to do a code review a while ago when I first started doing GUI configuration screens. Reasons included how Calibre can be invoked from the command line (plugin base classes still get loaded) as well as potential namespace collisions. One approach to get around this is to use a proxy approach that chaley kindly came up with for me and I have since put in place in a number of plugins in this forum. I can send you a "plugin template" I put together for it if you PM me an email (I now use it as the basis for all my plugins). Or else you can copy code from one of the recently updated plugin versions of mine. A "simpler" one to have less other stuff to remove from would be the Clipboard Search one. Of course I am sure there are other approaches to this, but as it came from one of the Calibre developers who knows far more about Python/Calibre than I ever will that was good enough for me . I couldn't even being to repeat with any confidence all the technical reasons why that approach is better beyond what I mentioned above. I just trust that it does have his and Kovid's seal of approval over dumping everything into the top level namespace in one code file. It would still be nice to have even more code files (I believe this is possible by extending the approach) but I haven't had a need to as yet. Not having to nest all my classes was the big win for me. |
Advert | |
|
02-10-2011, 09:50 PM | #3 |
Connoisseur
Posts: 80
Karma: 12933
Join Date: Feb 2011
Device: Galaxy Note 8, Sony PRS-650, Sony PRS-600
|
Thanks for the feedback kiwidude. This is my first foray into Calibre and Python development so I'm figuring things out as I go along. I'd love to get that "plugin template" so I can clean things up. I'll PM that email address.
|
02-11-2011, 11:32 AM | #4 |
Connoisseur
Posts: 80
Karma: 12933
Join Date: Feb 2011
Device: Galaxy Note 8, Sony PRS-650, Sony PRS-600
|
Updated plugin as per kiwidude's suggestions (Thanks!) to ensure deferral of module loading until required. New version is v1.0.1.
|
02-12-2011, 06:45 AM | #5 |
Sigil developer
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
kpw - great to see this plugin. I don't have a Sony, but I'm having a look over your plugin code to give me ideas on how to start re-organizing my code into classes.
Like you I've considered using multiple .py files to separate out the code sections - not strictly necessary but it might make things more readable. |
Advert | |
|
02-14-2011, 06:41 AM | #6 |
Connoisseur
Posts: 77
Karma: 9324
Join Date: Feb 2010
Device: Sony PRS-650, Kindle 3
|
Hi there,
I see you're trying to steal my customers ... nah, I was just kidding Good luck with your implementation, maybe I will try Python myself at some point. I just wanted to let you know how I calculate the time stamp. I just released a new beta version that updates the metadata, I hope that it works on all time zones. I'm waiting feedback on this. First I set the modified date to local date and time, then I extract the UTC (Coordinated Universal Time) date from this local date and write it in the xml file. Then I calculate the offset between UTC and local time, in minutes, and multiply this with -1. I write the result in the tz attribute. |
02-14-2011, 01:09 PM | #7 |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: PRS-650
|
hi kpw,
thanks for this cool plugin. just tried it with calibre 0.7.18 in Ubuntu Linux 10.10 64 bit, but it doesn't work for me. I get this error: Spoiler:
Not sure, if it is supposed to work in linux, but I thought plugins would be platform-independent. I'll try it in my virtual machine... |
02-15-2011, 03:11 AM | #8 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Code:
sudo python -c "import urllib2; exec urllib2.urlopen('http://status.calibre-ebook.com/linux_installer').read(); main()" |
|
02-15-2011, 01:32 PM | #9 |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: PRS-650
|
hi dwanthny,
thanks for your reply, i've upgraded to the latest calibre release and successfully installed the plugin now. unfortunately, once i start the plugin by clicking on "book list" I get the following error message: Spoiler:
btw, I'm using an PRS-650. I hope it's ok to post my error messages, it might help to find bugs. the rest seems to work, I can cofigure the plugin and everything, it just doesn't execute the script correctly. |
02-15-2011, 11:33 PM | #10 | ||
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Quote:
kpw will have to drop in to further help troubleshoot this problem. The only thing I would suggest (out of my own ignorance) is to restart your Linux box and restart (shutdown and turn on, not sleep mode) your 650. Good Luck. |
||
02-16-2011, 03:10 PM | #11 |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: PRS-650
|
yay, it's working now. I just had to deinstall the plugin, redownload and reinstall it. There must have been something wrong with my first download, since the error occured in windows as well.
thanks again kpw, this is a very useful plugin. And I can say: Tested and works on:
|
02-18-2011, 08:09 AM | #12 |
Enthusiast
Posts: 49
Karma: 12
Join Date: Feb 2011
Device: Kobo Aura, Sony PRS-350 and PRS-T1
|
Thanks kpw, that's just what I was looking for, an integrated plugin which would accomplish this. The problem is that upon install and trying to use it with my Sony PRS-350 attached, I get the following error message:
calibre, version 0.7.45 ERROR: Unhandled exception: <b>ValueError</b>:No JSON object could be decoded Traceback (most recent call last): File "C:\Users\Colauto\AppData\Roaming\calibre\plugins\ Manage Sony x50 Reader Book List.zip\ManageSonyX50BookList_plugin_code.py", line 71, in set_sony_book_list File "json\__init__.py", line 310, in loads File "json\decoder.py", line 346, in decode File "json\decoder.py", line 364, in raw_decode ValueError: No JSON object could be decoded Could you please give me a hand to get it up and running? I'm using Win7-64bit with Calibre 0.7.45. Just let me know if you need any additional information. |
02-18-2011, 01:41 PM | #13 |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: PRS-650
|
Hi Calibrefan,
this is exactly the same error that I got. I had to deinstall the plugin, redownload it from here, and reinstall it. Then it worked. Still don't know why... (maybe restarting the pc helped, maybe I still had the old version out of my browser cache, who knows?) If you want I can drop you my file with which it definitely worked under Win 7. Last edited by woodfrog; 02-18-2011 at 01:46 PM. |
02-20-2011, 04:31 AM | #14 |
Enthusiast
Posts: 49
Karma: 12
Join Date: Feb 2011
Device: Kobo Aura, Sony PRS-350 and PRS-T1
|
Hi woodfrog,
I didn't notice that you had the same problem at first because I thought you were having the trouble in Ubuntu rather than Win7x64. In the mean time I've reinstalled the plug-in, like you did, but I had no luck there. The problem persists. If you don't mind I'd like to try your working version to see if that works for me also if you care to drop me the file. Thanks in advance! |
02-20-2011, 02:15 PM | #15 |
Tatütatuter
Posts: 390
Karma: 3148
Join Date: Oct 2008
Location: Germany, Baden, Karlsruhe
Device: Aura H2O, Glo HD, Paperwhite, PRS-950
|
With W7 32bit, calibre 7.45 - no problems. Works as suggested.
Thank you kpw! |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Copy book covers as Standby images (Sony/Kindle/Nook) | jackie_w | Plugins | 136 | 06-18-2020 03:27 AM |
Calibre plugin - Copy book covers to use as Standby images (PRS600/x50) | jackie_w | Sony Reader | 39 | 06-18-2016 07:06 PM |
Calibre strange characters book list on Sony Reader | Imatechie2006 | Calibre | 0 | 01-21-2010 01:45 AM |
How do you manage your 'reading list'? | astrodad | Workshop | 30 | 04-18-2008 02:23 PM |
ml_ipod - WinAmp plugin to manage your iPod | doctorow | Lounge | 3 | 07-01-2004 01:31 PM |