|
|
View Full Version : The 505 in libprs500
kovidgoyal 10-18-2007, 01:16 PM Just committed initial support for the 505 (command line only, linux only) to svn. I'd appreciate a little testing from those of you that have the 505 and use linux.
The command line interface is the same as that for the 500 (i.e. the command prs500)
You may need to install dbus-python (also called python-dbus)
kovidgoyal 10-18-2007, 04:59 PM Incidentally does anyone know how I can find programatically where a given USB removable drive (identified by product and vendor ids) is mounted on windows?
Hadrien 10-18-2007, 05:01 PM Incidentally does anyone know how I can find programatically where a given USB removable drive (identified by product and vendor ids) is mounted on windows?
Working on auto-sync features ? ;-)
kovidgoyal 10-18-2007, 05:02 PM No need that to support the 505 in libprs500.
JSWolf 10-18-2007, 05:31 PM No need that to support the 505 in libprs500.
Do you think it's possible to enable libprs505 to be able to use and create collections on the 505? That way people not on Windows can setup collections as they want. Even with the new menus, I still use the collections.
kovidgoyal 10-18-2007, 05:39 PM Yeah it already supports collections on the 500 supporting the on the 505 will be not much extra work.
JSWolf 10-18-2007, 05:46 PM So is this easier then you expected it to be to get it working with the 505?
kovidgoyal 10-18-2007, 05:51 PM I expected it to be easy and it is. The only hard part is the operating system integration for 3 different OSes. I expect windows and OSX to give me much more trouble, but atleast users of the 505 wont have driver conflicts with the connect software.
mrkai 10-18-2007, 05:57 PM I expect windows and OSX to give me much more trouble, but atleast users of the 505 wont have driver conflicts with the connect software.
...do you believe will be problematic? Determining if a volume is a removable (for example) is rather trivial, for example...
kovidgoyal 10-18-2007, 06:20 PM An hour of googling and the best way i can come up with in windows to find where a particular USB drive is mounted is a commandline program, which would impose a lot of unecessary overhead when polling.
I haven't looked at OSX but from my past experiences I'm dreading it. Both OSes because they have a strict policy of "users" first seems to have a dearth of good development tools that are also free. Of course I may not be the best judge of things, since I am mostly a linux guy.
kovidgoyal 10-18-2007, 10:13 PM No one knows how to do this?
mrkai 10-19-2007, 02:05 AM Both OSes because they have a strict policy of "users" first seems to have a dearth of good development tools that are also free.
...for mac os x is in fact free, ships with every mac, and is included with every commercially sold copy of mac os x; it is also available in its entirety as a free download from apple.
anyway, os x has a mechanism that is the inverse of polling (very inefficient) where you simple tell the os to tell you when a removable is mounted, what it was, and then your code decides what to do with it.
I'm not a python guy, but i know that pyobjc bridges the cocoa apis direct to python...and that this bridge actually will be shipping by default on the system with 10.5. right now, you bundle it if you wish to use it.
JSWolf 10-19-2007, 05:56 AM mrkai, but what about system running a prior OS X such as 10.4 or maybe 10.3?
shondark 10-19-2007, 09:03 AM Hi! I've been reading this forums for a lot of time and now that I'm almost in possesion of my PRS-505 y want to try to participate a little more..
I don't know but maybe this could help you Kovid.
http://www.ureader.com/message/1018345.aspx
If not, if you could explain what do you want this function to do we could try to help you.
And sorry for my english... :P
sputnik_1 10-19-2007, 10:12 AM No one knows how to do this?
I think what you're looking for is this key in the registry :
HKEY_Local_Machine\SYSTEM\Current Control Set\Enum\USB\Vid_054c&Pid_031e
As far as I know, those Pid's are unique per device -- so you should only see those if you have a PRS-505 that's been attached. Doing a search for this key may be the easiest way, I'll dig and see if there's another easier identifier.
igorsk 10-19-2007, 11:26 AM I'll have a look at how eBook Library interfaces with 505 but a little later...
Matter 10-19-2007, 11:39 AM Apple Dev Connection has reference to some classes and methods that should help you out (I think, assuming you can import them successfully in your Python code). The two libraries I could find are at: http://developer.apple.com/reference/HardwareDrivers/idxUSB-date.html
kovidgoyal 10-19-2007, 12:33 PM ...for mac os x is in fact free, ships with every mac, and is included with every commercially sold copy of mac os x; it is also available in its entirety as a free download from apple.
anyway, os x has a mechanism that is the inverse of polling (very inefficient) where you simple tell the os to tell you when a removable is mounted, what it was, and then your code decides what to do with it.
I'm not a python guy, but i know that pyobjc bridges the cocoa apis direct to python...and that this bridge actually will be shipping by default on the system with 10.5. right now, you bundle it if you wish to use it.
I'm glad to hear that it does have this. Do you have a link to some documentation about this system. I can always write a python extension to use cocoa, or ship pyobjc with libprs500.
kovidgoyal 10-19-2007, 12:40 PM Hi! I've been reading this forums for a lot of time and now that I'm almost in possesion of my PRS-505 y want to try to participate a little more..
I don't know but maybe this could help you Kovid.
http://www.ureader.com/message/1018345.aspx
If not, if you could explain what do you want this function to do we could try to help you.
And sorry for my english... :P
That looks interesting, but I would like something a little more authoritative than a forum message to base my code off. What I need is some way to go from a USB vendor ID and device ID to the drive letter where the usb device is mapped. Preferably using some well defined OS API that is stable across XP and Vista.
kovidgoyal 10-19-2007, 12:43 PM I think what you're looking for is this key in the registry :
HKEY_Local_Machine\SYSTEM\Current Control Set\Enum\USB\Vid_054c&Pid_031e
As far as I know, those Pid's are unique per device -- so you should only see those if you have a PRS-505 that's been attached. Doing a search for this key may be the easiest way, I'll dig and see if there's another easier identifier.
That sounds like it should work, I'll test it on XP and vista and see if it does.
EDIT: As far as I can tell this only allows for presence testing. I can't figure out how to find the drive letter its mapped to,
smcclain 10-19-2007, 06:58 PM You should be able to use windows WMI api to get the info... here's and example VBS script I found on MSDN that enumerates the physical drives on the system and determines the drive letter. Simply save the the code to a text file and give the file a .vbs extension and you sould be able to run in in windows just by double clicking it. Hope this helps you.
ComputerName = "."
Set wmiServices = GetObject ( _
"winmgmts:{impersonationLevel=Impersonate}!//" _
& ComputerName)
' Get physical disk drive
Set wmiDiskDrives = wmiServices.ExecQuery ( _
"SELECT Caption, DeviceID, PNPDeviceID FROM Win32_DiskDrive")
For Each wmiDiskDrive In wmiDiskDrives
WScript.Echo "Disk drive Caption: " _
& wmiDiskDrive.Caption _
& VbNewLine & "PNPDeviceID: " _
& " (" & wmiDiskDrive.PNPDeviceID & ")"
'Use the disk drive device id to
' find associated partition
query = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" _
& wmiDiskDrive.DeviceID & "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition"
Set wmiDiskPartitions = wmiServices.ExecQuery(query)
For Each wmiDiskPartition In wmiDiskPartitions
'Use partition device id to find logical disk
Set wmiLogicalDisks = wmiServices.ExecQuery _
("ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" _
& wmiDiskPartition.DeviceID & "'} WHERE AssocClass = Win32_LogicalDiskToPartition")
For Each wmiLogicalDisk In wmiLogicalDisks
WScript.Echo "Drive letter associated" _
& " with disk drive = " _
& wmiDiskDrive.Caption _
& wmiDiskDrive.PNPDeviceID _
& VbNewLine & " Partition = " _
& wmiDiskPartition.DeviceID _
& VbNewLine & " is " _
& wmiLogicalDisk.DeviceID
Next
Next
Next
kovidgoyal 10-19-2007, 07:56 PM Thanks WMI should do the trick for windows.
kovidgoyal 10-20-2007, 12:40 PM SVN now has working commandline implementations for both linux and windows. OSX is the only holdout.
JSWolf 10-20-2007, 01:47 PM Nice work!
mrkai 10-21-2007, 02:59 AM I'm glad to hear that it does have this. Do you have a link to some documentation about this system. I can always write a python extension to use cocoa, or ship pyobjc with libprs500.
http://www.oreillynet.com/pub/a/mac/2003/01/31/pyobjc_one.html
Look for NSWorkSpace on this page. This code is a python example of how one would do what i was talking about.
I suppose in the case of the 505's internal memory, one would look for say,database/media|cache|sync on whatever path the notification gives the handler there (path = aNotification.userInfo()['NSDevicePath'] in that example) and run with it...process the metadata in cache/media.xml...get a raw file listing, etc/whatever.
Hope that help in some way :)
-K
kovidgoyal 10-21-2007, 12:23 PM Notification isn't enough what if the device was attached before the app is started. Also notification requires an apple event loop running whereas my app has a qt event loop. Doubt they'd be enough. Also detecting by path is inadequate, especially in the case of the storage card as that may not have any directory structure if it has been inserted for the first time.
kovidgoyal 10-24-2007, 05:20 PM Released 0.4.13 which supports the 505 in both windows and linux. Note that support is not well tested. You may lose history/bookmarks or have to reset your reader occassionally. If that happens, please open a bug report with the exact sequence of operations you performed while transferring to the reader.
mrkai 10-25-2007, 08:05 AM Notification isn't enough what if the device was attached before the app is started. Also notification requires an apple event loop running whereas my app has a qt event loop. Doubt they'd be enough. Also detecting by path is inadequate, especially in the case of the storage card as that may not have any directory structure if it has been inserted for the first time.
...and as an experienced OS X programmer, these are all trivial case, really.
on launch, you check the mounted volumes, of course :)
The PRS-505 actually comes up in the device registry a couple of different ways and the SD comes up listed separate from the internal memory as a different device.
os x provides a shell tool call ioreg that lasts these; grepping the output for the 505 show them. it tells you the "BSD Device" is a quasi abstract way but its still a bit indirect without fooling around in iokit.
It i were doing this, I'd simply have the user "tag" and SD they wanted to use with the app; this way they could manage the content even if the reader wasn't plugged in.
But that's just me :)
kovidgoyal 10-25-2007, 11:33 AM Again I don't want to have to rely on the file structure of either the internal memory or the card. I think that's just asking the user to perform one step more than necessary. ioreg sounds like it might work, though having to run a commandline program just to find out what devices are attached to the system seems like a lot of unnecessary overhead. Maybe I'll just have to bite the bullet and look at IOKit.
mrkai 10-26-2007, 01:59 AM ...ioreg sounds like it might work, though having to run a commandline program just to find out what devices are attached to the system seems like a lot of unnecessary overhead. Maybe I'll just have to bite the bullet and look at IOKit.
...the polling that you are doing is *horrible* on OS X. looking at drives onlyhen the state changes is a *far* superior solution (on any os, really)..if if you are doing this via iokit or some other means to determine if the PRS 505 is connected.
Since with the 505 there is no need for direct manipulation of the data via a protocol (thank you Sony for Mass Storage support!) it would be a far better *user experience* to not constantly scan for what you are looking for and let the os tell you its a good time to work.
While this might not be the more...geeky"MIT" way of solving the "
kovidgoyal 10-26-2007, 02:30 AM Jesus! I don't want to write a OS notify solution, because that would mean making my app depend on an different event loop in each OS. That is going to cause far more problems than it solves. Indeed, I dont want to have to depend on an event loop at all for the command line interface and writing separate code for each interface for 3 different platforms is just not acceptable. I already have a perfectly good polling based solution (using libusb, which I've ported to OS X) that takes very little system resource, just run libprs500 and see and that works perfectly well on 3 different platforms.
All I need now is a simple way to map usb product ids to mount points that does not depend on having a particular file system. I'm hoping ioreg does that. It doesn't matter if ioreg is resource heavy since this call is made only on initial device detection.
mrkai 10-26-2007, 03:34 PM ...ioreg sounds like it might work, though having to run a commandline program just to find out what devices are attached to the system seems like a lot of unnecessary overhead. Maybe I'll just have to bite the bullet and look at IOKit.
...as the polling that you are doing is *horrible* on OS X. looking at drives only when the state changes is a *far* superior solution (on any os, really)..if if you are doing this via iokit or some other means to determine if the PRS 505 is connected.
Since with the 505 there is no need for direct manipulation of the data via a protocol (thank you Sony for Mass Storage support!) it would be a far better *user experience* to not constantly scan for what you are looking for and let the os tell you its a good time to work.
While this might not be the more...geeky "MIT" way of solving the "is the the Reader's mass storage volume?" it is most definitely a better experience for the *user* on OS X in that "Bell Labs" sort of way :)
To put it another way: OS X is a *nix...python is a scripting language. You *could* say, use iokit and some code like this (http://handbrake.m0k.org/trac/changeset/829?format=diff&new=829)...figure out how to wrap it, etc...
or, simply do this when the system tells you its got a new removable mounted:
mount|grep `ioreg -n "Sony PRS-505/UC Media" |grep "BSD Name"|cut -d'"' -f4`|cut -d' ' -f3
If the 505 is one of those volumes, you'd have the path of the reader's internal store. :)
Or not :) Its your software :)
lima tango 10-27-2007, 11:09 PM love to help once you get to Mac OS.
kovidgoyal 10-27-2007, 11:16 PM next on my todo list ;-)
kovidgoyal 11-01-2007, 03:52 PM version 0.4.17 has initial support for OS X in both GUI and commandline.
Konquest 11-08-2007, 12:10 AM Ive been trying to run libprs500 on vista 32 for my prs-505 and its not working. I followed the directions (uninstall drivers etc) and libprs installs fine. When I run it with my reader connected via usb, the program freezes up and my mouse cursor goes crazy.
kovidgoyal 11-08-2007, 03:10 AM Hmm what happens if you try the following command in a terminal, with your reader connected?
prs500 df
Konquest 11-08-2007, 03:33 PM hmm terminal? do I need linux for that, I only have vista on this machine :(
kovidgoyal 11-08-2007, 03:39 PM Windows key+R then type cmd.exe and press enter.
Konquest 11-08-2007, 04:50 PM i tried that, i see the prs500.exe process running in task manager but nothing happens in the cmd prompt after i run it. I tried running libprs with that going, same problem.
kovidgoyal 11-08-2007, 04:52 PM Hmm when you plug in the device it opens in windows explorer?
Konquest 11-08-2007, 05:05 PM yeah i can access it through explorer and dragon drop my books.
kovidgoyal 11-08-2007, 05:09 PM This may be a vista specific problem. Do you have access to an XP machine where you can try it? IS there anyone else that has used libprs500 with a 505 on vista?
Konquest 11-09-2007, 09:09 PM same problem in XP as well
kovidgoyal 11-09-2007, 09:34 PM Hmm it works for me on XP with v0.4.18. Try running prs500 df and then wait 10secs and press Ctrl+C hopefully that will tell us where it's hanging.
FlyTags 11-09-2007, 10:32 PM Hello. First off, thanks a ton for the work you're putting into this. I just picked up my Sony Reader this morning and this looks to be a great tool!
Anyway, I just thought I'd jump in here, as I'm having the same problem on Vista32 (haven't tried it on XP). I ran libprs v0.4.18 with my PRS-505 connected and it doesn't do anything. Just hangs. I ran 'prs500 df' under the command line and nothing happened - just a blinking cursor. I let it sit for a few minutes, hit ctrl+c, and this is what I got:
C:\Users\XXX>prs500 df
Traceback (most recent call last):
File "main.py", line 346, in <module>
File "main.py", line 224, in main
File "libprs500\devices\prs505\driver.pyo", line 217, in open
File "libprs500\devices\prs505\driver.pyo", line 217, in open
File "libprs500\devices\prs505\driver.pyo", line 217, in open
File "libprs500\devices\prs505\driver.pyo", line 217, in open
File "libprs500\devices\prs505\driver.pyo", line 217, in open
File "libprs500\devices\prs505\driver.pyo", line 217, in open
File "libprs500\devices\prs505\driver.pyo", line 216, in open
KeyboardInterrupt
Hope this helps!
-FlyTags
kovidgoyal 11-09-2007, 11:04 PM Well that error means for some reason the routine that finds out which drive letter the sony reader is mounted on, is failing. It works for me, so in order to debug it, you're going to have to do a little work.
First, install python 2.5 from python.org
then install the following two packages
https://sourceforge.net/projects/pywin32/
then
http://tgolden.sc.sabren.com/python/wmi.html
Then open a terminal and start the python interpreter which should be something like
c:\Python25\python.exe
At the interpreter prompt type or paste the following commands
import wmi
c = wmi.WMI()
drives = c.Win32_DiskDrive()
ids = [d.PNPDeviceID for d in drives]
print ids
Post the output of the print command. Do this with the reader connected.
FlyTags 11-09-2007, 11:41 PM Alright, done (I think). Here's the output I came up with:
C:\Python25>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wmi
>>> c = wmi.WMI()
>>> drives = c.Win32_DiskDrive()
>>> ids = [d.PNPDeviceID for d in drives]
>>> print ids
[u'IDE\\DISKWDC_WD4000KD-00NAB0_____________________01.06A01\\5&18DB71A7&0&1.0.0
', u'IDE\\DISKWDC_WD5000AAKS-00YGA0___________________12.01C02\\5&621C102&0&0.0.
0', u'USBSTOR\\DISK&VEN_GENERIC&PROD_STORAGE_DEVICE&REV_9339\\200612070A&0', u'U
SBSTOR\\DISK&VEN_GENERIC&PROD_STORAGE_DEVICE&REV_9339\\200612070A&1', u'USBSTOR\
\DISK&VEN_GENERIC&PROD_STORAGE_DEVICE&REV_9339\\200612070A&2', u'USBSTOR\\DISK&V
EN_GENERIC&PROD_STORAGE_DEVICE&REV_9339\\200612070A&3', u'USBSTOR\\DISK&VEN_MEMO
REX&PROD_TD_CLASSIC_003C&REV_1.02\\0D504A5162704A20&0', u'USBSTOR\\DISK&VEN_SONY
&PROD_PRS-505/UC&REV_1000\\080046100042D42E&0', u'USBSTOR\\DISK&VEN_SONY&PROD_PR
S-505/UC:MS&REV_1000\\080046100042D42E&1', u'USBSTOR\\DISK&VEN_SONY&PROD_PRS-505
/UC:SD&REV_1000\\080046100042D42E&2']
>>>
Let me know if there's anything else I can do to help you out!
-FlyTags
kovidgoyal 11-09-2007, 11:51 PM So far it looks good
Now try the following code
import wmi
c = wmi.WMI()
drives = c.Win32_DiskDrive()
ids = [d.PNPDeviceID for d in drives]
partitions = [d.Partitions for d in drives]
print zip(ids, partitions)
FlyTags 11-09-2007, 11:57 PM And the result:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wmi
>>> c = wmi.WMI()
>>> drives = c.Win32_DiskDrive()
>>> ids = [d.PNPDeviceID for d in drives]
>>> partitions = [d.Partitions for d in drives]
>>> print zip(ids, partitions)
[(u'IDE\\DISKWDC_WD4000KD-00NAB0_____________________01.06A01\\5&18DB71A7&0&1.0.
0', 1), (u'IDE\\DISKWDC_WD5000AAKS-00YGA0___________________12.01C02\\5&621C102&
0&0.0.0', 3), (u'USBSTOR\\DISK&VEN_GENERIC&PROD_STORAGE_DEVICE&REV_9339\\2006120
70A&0', 0), (u'USBSTOR\\DISK&VEN_GENERIC&PROD_STORAGE_DEVICE&REV_9339\\200612070
A&1', 0), (u'USBSTOR\\DISK&VEN_GENERIC&PROD_STORAGE_DEVICE&REV_9339\\200612070A&
2', 1), (u'USBSTOR\\DISK&VEN_GENERIC&PROD_STORAGE_DEVICE&REV_9339\\200612070A&3'
, 0), (u'USBSTOR\\DISK&VEN_MEMOREX&PROD_TD_CLASSIC_003C&REV_1.02\\0D504A5162704A
20&0', 1), (u'USBSTOR\\DISK&VEN_SONY&PROD_PRS-505/UC&REV_1000\\080046100042D42E&
0', 1), (u'USBSTOR\\DISK&VEN_SONY&PROD_PRS-505/UC:MS&REV_1000\\080046100042D42E&
1', 0), (u'USBSTOR\\DISK&VEN_SONY&PROD_PRS-505/UC:SD&REV_1000\\080046100042D42E&
2', 0)]
>>>
-FlyTags
kovidgoyal 11-10-2007, 12:00 AM ok now
import wmi
c = wmi.WMI()
drives = c.Win32_DiskDrive()
mm = drives[-3]
print mm
FlyTags 11-10-2007, 12:10 AM And...
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wmi
>>> c = wmi.WMI()
>>> drives = c.Win32_DiskDrive()
>>> mm = drives[-3]
>>> print mm
instance of Win32_DiskDrive
{
BytesPerSector = 512;
Capabilities = {3, 4, 7};
CapabilityDescriptions = {"Random Access", "Supports Writing", "Supports
Removable Media"};
Caption = "Sony PRS-505/UC USB Device";
ConfigManagerErrorCode = 0;
ConfigManagerUserConfig = FALSE;
CreationClassName = "Win32_DiskDrive";
Description = "Disk drive";
DeviceID = "\\\\.\\PHYSICALDRIVE7";
FirmwareRevision = "1000";
Index = 7;
InterfaceType = "USB";
Manufacturer = "(Standard disk drives)";
MediaLoaded = TRUE;
MediaType = "Removable Media";
Model = "Sony PRS-505/UC USB Device";
Name = "\\\\.\\PHYSICALDRIVE7";
Partitions = 1;
PNPDeviceID = "USBSTOR\\DISK&VEN_SONY&PROD_PRS-505/UC&REV_1000\\08004610
0042D42E&0";
SectorsPerTrack = 63;
Signature = 1;
Size = "213857280";
Status = "OK";
SystemCreationClassName = "Win32_ComputerSystem";
SystemName = "ARTEMIS";
TotalCylinders = "26";
TotalHeads = 255;
TotalSectors = "417690";
TotalTracks = "6630";
TracksPerCylinder = 255;
};
>>>
kovidgoyal 11-10-2007, 12:12 AM OK that shows me the problem. Expect it to be fixed in the next release. Thanks for taking the trouble.
FlyTags 11-10-2007, 12:15 AM Hey, great to hear and it wasn't any trouble at all. It was my first time playing around with Python (and I had no idea what I was typing), but it was fun nonetheless.
Anyway, thanks again for your hard work. It's much appreciated.
And now, I'm off to bed... Good night!
-FlyTags
kovidgoyal 11-10-2007, 12:42 AM Actually since this is a windows only pure bugfix I just re-released 0.4.18 so re-install and you should be good to go.
Konquest 11-10-2007, 12:54 AM Nice job Kovid it works now! But my mouse cursor is still going crazy, it keeps kicking it to the top right corner of my screen every 20 secs
kovidgoyal 11-10-2007, 01:04 AM I doubt that has anything to do with libprs500. There is no mouse related code in libprs500 and it uses the standard windows driver to access the 505.
FlyTags 11-10-2007, 11:01 AM Hey, just to let you know - I loaded up the 0.4.18 re-release this morning. No problems at all. Everything works perfectly now. Great job!
-FlyTags
jeff363 11-11-2007, 11:51 AM Kovid - Do you have a revision history (or log) for each of your releases for LIBPRS500? I just installed 04.18 (BTW - I love this software over the Sony e-book software!!! You can do so much more to the e-books so that they look great on the Sony Reader) and I noticed that you have 04.19, but don't want to have to keep reinstalling if I know what the changes are. Thanks...
kovidgoyal 11-11-2007, 11:55 AM https://libprs500.kovidgoyal.net/timeline
Every version bump is a separate commit so just look for the changesets between the last version bump and the current one.
jeff363 11-11-2007, 11:59 AM Thank you so much for the quick response!
I looked at the hyperlink you added and yet, on the page, I still could not detect where 04.18 was and where 04.19 is so that I can see the change? What am I not looking at? How do I find a "Version Bump" in the list?
kovidgoyal 11-11-2007, 12:00 PM Just search the page for the string 0.4.18
EDIT: Here's a slightly friendlier link
https://libprs500.kovidgoyal.net/timeline?from=11%2F11%2F07&daysback=60&changeset=on&wiki=on&update=Update
jeff363 11-11-2007, 12:05 PM I got it!! This is done differently than most revision histories I have seen. Most of them are more like a list of things that have changed and that was what I was trying to look for. This version is more like coding changes, which takes a little more reading to understand. But works!! Thank You...
kovidgoyal 11-11-2007, 12:09 PM Yeah I don't have the time to maintain a separate list of changes, since I typically release libprs500 once a week. Perhaps once development slows down I'll add a traditional changelog.
jeff363 11-11-2007, 12:11 PM Kovid - Don't get me wrong. The link that you sent works great and the updates that you do are FAR more important.
Again, Thanks..
intenost 11-11-2007, 09:46 PM Hi just got a Sony PRS-505 and I'm getting acquainted with what it can do. I luckily found this site and your application which as a Mac user (although I do run Windows in a virtual machine when necessary) it will be very nice to interact with the Reader via OS/X.
I just downloaded 0.4.19 and get the following whenever fetching news (any of the 3 feeds). I saw this error came up earlier in the thread, not sure if it's been fixed in the past, but I wanted to report it.
Detailed traceback:
Traceback (most recent call last):
File "/Applications/libprs500.app/Contents/Resources/main.py", line 513, in news_fetched
File "/Applications/libprs500.app/Contents/Resources/main.py", line 279, in _add_books
File "libprs500/ebooks/metadata/meta.pyo", line 25, in get_metadata
File "libprs500/ebooks/lrf/meta.pyo", line 256, in get_metadata
File "libprs500/ebooks/lrf/meta.pyo", line 477, in __init__
File "libprs500/ebooks/lrf/meta.pyo", line 76, in __get__
File "libprs500/ebooks/lrf/meta.pyo", line 343, in restore_pos
File "libprs500/ebooks/lrf/meta.pyo", line 521, in unpack
File "struct.pyo", line 87, in unpack
error: unpack requires a string argument of length 6
Thanks and Regards,
-Ost
kovidgoyal 11-11-2007, 10:28 PM Oops looks like I introduced a new bug. For the time being use the commandline
web2lrf nytimes
JeffB 11-12-2007, 01:49 AM Frankly, if Sony supported the 500/505 1/10th as well as Kovid, they'd have the best reader on the market.
As an OS-X user, I'm constantly frustrated by the hoops I have to jump through in order to even use the device the way it's intended.
pcskibum 11-12-2007, 02:40 PM When I convert a file and try to save it to a folder I get the following message:
[Errno 2] No such file or directory: u'C:/Download Temp\\Daniel Silva\\Kill Artist \\Kill Artist - Daniel Silva_88.lrf'
Detailed traceback:
Traceback (most recent call last):
File "main.py", line 479, in save_to_disk
File "libprs500\gui2\library.pyo", line 130, in save_to_disk
File "libprs500\library\database.pyo", line 1090, in export_to_dir
IOError: [Errno 2] No such file or directory: u'C:/Download Temp\\Daniel Silva\\Kill Artist \\Kill Artist - Daniel Silva_88.lrf'
For some reason it adds a u' in front of the path. Am I doing something wrong? How do I correct this?
Thanks
shoggot 11-16-2007, 11:06 AM When I convert an html file to lrf via libprs (or via any2lrf, or via html2lrf on commandline, I get an interesting situation:
Not liking the short-bus fonts of the 'true' Table of Contents display, I instead use simple html links, roughly like so:
<p><a href="#position1">chapter 1</a></p>
<p><a href="#position2">chapter 2</a></p>
<p><a href="#position3">chapter 3</a></p>
<p><a href="#position4">chapter 4</a></p>
...
<a name="position1"></a><b>chapter 1</b><br>
Content
...
<a name="position2"></a><b>chapter 2</b><br>
Content
...
<a name="position3"></a><b>chapter 3</b><br>
Content
...
<a name="position4"></a><b>chapter 4</b><br>
Content
...
This turns into a nice lrf, with links, etc - but! When I choose, say, 'chapter 3', I will, instead, be transported to the page which contains 'chapter 2' and the name tag 'position2'. IE, it always goes to the tag prior, for inexplicable reason.
I can work around this, via offsetting links / anchors, but it's annoying, patently.
prs-505 = reader, librs500 is being used for conversion, movement/maintenance I'm doing manually, so haven't moved up in version (haven't noted anything in changed which would seem to pertain to this).
kovidgoyal 11-16-2007, 12:09 PM Hmm adding a style="page-break-before: always" to the <a name> tags should fix this.
shoggot 11-16-2007, 12:34 PM Thank you, testing now.
EDIT: clarification, would this be the syntax?
DCA1-BHN7ZB1# ./html2lrf.exe --page-break-before-tag="a name" --font-delta=-2 --left-margin=5 --right-margin=5 --top-margin=5 Clus4.htm
IE, does it know that the matching text should be in a <> construct? Or should the match be "<a name="?
EDIT2: Didn't work as above, also tried --force-page-break-before-tag & having the string = "<a name=", with same results... Going to stick an empty <h12> text at each point, trying that now.
shoggot 11-16-2007, 12:58 PM d'oh, that h[12] would be h1 or h2. Trying again. (currently have<h1> </h1><a name="position1"></a>in place, with string for page-break-before-tag = " ")
Testing...
Well, that's interesting. The links now go to the correct location - but there's no page break there. The links are working correctly now at least, and that's the main thing for me.
kovidgoyal 11-16-2007, 01:02 PM If all you need is chapter headings to link to the following html will work
<a href="#chap1">....
<h2 style="page-break-before:always" id="chap1">Chapter 1</h2>
...
shoggot 11-16-2007, 01:06 PM mm, but would that result in a table-of-contents listing? I'm actively trying to avoid that. Though I note the link... Anyway, thanks for pointing me in the right direction. You do good work, based on what I've read here and on the linprs500 site.
kovidgoyal 11-16-2007, 01:08 PM The most flexible way to control what goes into the table of contents is to use an OPF file to specify a separate html file that contains only those links that you want in the TOC
shoggot 11-20-2007, 07:43 AM Side note - I've noticed that a file with closing <p> tags (</p>) take on the order of 12x time to process via html2lrf.exe - 3.2MB file, has ~14k <p> tags. About 15 seconds without the close tags, about 4 minutes with.
kovidgoyal 11-20-2007, 11:46 AM Thats an interesting observation. One way to figure out why that may be is to run html2lrf with the --verbose switch. It will then write the result of the pre-processed HTML to a file. It may be that the preprocessed HTML is more complex in the second case. In any case, I would appreciate it if you could send me this file.
shoggot 11-20-2007, 02:09 PM Mmm, the file itself contains material covered under copyright... but as I've replicated the results with three separate files now, it should be easy enough to replicate.
The files were each over 3MB (as .htm files), and contained only the bare essential tags, so could be replicated like so, under bash:
echo "<html><head></head><body></body>" > foo.htm
num=1
while [[ $num -lt 50000 ]];do
echo "<p>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 </p>" >> foo.htm
num=$(($num+1))
done
echo "</body></html>" >> foo.htm
And this is the commandline used against the result:
./html2lrf.exe --title="barfoo" --author="foobar" --font-delta=-2 --left-margin=5 --right-margin=5 --top-margin=5 foo.htm
Followed by a
sed -e s/"<\/p>"//g foo.htm > foo2.htm
And run the commandline against that. Output seems to be identical, or within a few bytes either way. On-reader appearance is identical, anyway - just processing times.
I'm running a truncated version of that test file with verbose options, to see the results:
Well, the result's interesting (temp files). Snipping for space, but you'll see the diff (and I have no idea why it should have any effect.)
With </p> tags:
<html><head></head><body></body>
<p>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 </p>
<p>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 </p>
...
<p>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 </p>
</html>
Without </p> tags:
<html><head></head><body></body>
<p>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
</p><p>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
</p><p>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
</p><p>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
</p></html>
The closed </body> tag is due to my malforming the input html, but there you go.
If you really have to have the original file, I guess we'll make it happen in the name of progress, but I'd prefer to bypass that step.
kovidgoyal 11-20-2007, 02:18 PM That test case is fine, I don't need the original file. I'll look into it.
kovidgoyal 11-20-2007, 02:40 PM The basic reason is that the HTML "<p>phrase </p>\n<p>" becomes a P object containing a single text object, then a text object and then another <p> object while "<p>phrase \n<p>" becomes two P objects, each containing a single text object. Not much I can do about that I'm afraid, as that is the correct object representation of the HTML
EDIT: Incidentally you should use the --base-font-size option instead of --font-delta
MSWallack 11-23-2007, 11:51 PM I'm not sure if I've found a problem or if I'm getting the expected result. I finally connected my 505 to libprs500 (v0.4.24). In the table of contents of the 505, it appears that every book that I've added by using libprs has the author listed as Author Author (e.g., Arthur C. Clarke Arthur C. Clarke). Is this simply showing the Author field followed by the Author sort field or is something odd happening?
kovidgoyal 11-24-2007, 12:17 PM Hmm not sure why that should be happening. Can you save one these files to the disk and run lrf-meta on them.
MSWallack 11-24-2007, 12:31 PM Author (kana) is Clarke, Arthur C.
Author is Arthur C. Clarke
kovidgoyal 11-24-2007, 01:21 PM OK I see you've opened a bug report, I'll look at it when I return.
spooky69 11-25-2007, 06:23 AM Hey, I plan on purchasing the PRS-505 within the next couple of months and I'd just like to say that I'm glad that there is somebody so dedicated to making the device as good as possible. I feel a lot more confident about my purchase because of this. Keep up the good work!
pcboy70 12-03-2007, 02:49 PM I just joined this forum (just got a PRS-505). Looks like a great source of info.
I just installed the current version of libprs500 on my MacBook Pro running OS X.5.1 and it seems to mostly work (haven't tried everything yet but I did try the RSS feed from the BBC and it worked well) but - I can see my library, reader and my SD card but not my MS card (both are installed in the reader). Am I missing a step or does this need to be addressed?
Looking forward to using the software since Sony doesn't seem to care about me and my Mac!
pcboy70
kovidgoyal 12-03-2007, 02:55 PM libprs500 only supports one card at a time. That's not going to change.
kovidgoyal 12-11-2007, 02:07 PM Just to let everyone know, as far as I know, all outstanding issues with the 505 have been resolved.
JSWolf 12-11-2007, 02:42 PM Just to let everyone know, as far as I know, all outstanding issues with the 505 have been resolved.
Very nice!
UPMan 12-13-2007, 09:14 AM I've searched the forums and wiki and cannot find the answer to this. In the nytimes script, the username and password are used. I want to hard code these values into my script, but can't figure out how to do this. I've tried several methods (making assumptions from my Visual C++, VBasic, etc background...I've not snaked around with Python before) but none are working.
I thought adding:
self.username = 'myname'
self.password = 'mypassword'
just before the "if" clause would set those values, but the script still returns results as though the name/password were not provided. I'm sure I'm missing something simple...
kovidgoyal 12-13-2007, 01:04 PM Just write another script in your favorite language that calls web2lrf like this
web2lrf --username myusername --password mypassword nytimes
UPMan 12-13-2007, 02:05 PM Yep, I was making it way too hard. Might want to add that note on the Wiki for all us neophytes to benefit from.
Thanks!
cjones 12-17-2007, 12:55 AM About 75% of the PDFs I convert give me this error message after I've converted them and try to upload them. I have a 505 and am running Vista. Doesn't matter if I try to transfer to the built in storage or to a card.
IOError: [Errno 2] No such file or directory: u'G:\\database/media/books\\The Tipping\nPoint - Malcolm Gladwell_3.lrf'
Failed to perform job: Upload books to device: The Tipping Point
Further device related error messages will not be shown while this message is visible.
Detailed traceback:
Traceback (most recent call last):
File "libprs500\gui2\jobs.pyo", line 79, in run
File "libprs500\gui2\device.pyo", line 111, in upload_books
File "libprs500\devices\prs505\driver.pyo", line 383, in upload_books
File "libprs500\devices\prs505\driver.pyo", line 341, in put_file
IOError: [Errno 2] No such file or directory: u'G:\\database/media/books\\The Tipping\nPoint - Malcolm Gladwell_3.lrf'
TheLongshot 12-25-2007, 10:01 PM I have a problem uploading lit files to libprs500 4.30. When I try to add a file I get:
not well-formed (invalid token): line 23, column 32
Detailed traceback:
Traceback (most recent call last):
File "main.py", line 283, in add_books
File "main.py", line 308, in _add_books
File "libprs500\gui2\library.pyo", line 127, in add_books
File "libprs500\library\database.pyo", line 1082, in add_books
File "libprs500\ebooks\metadata\opf.pyo", line 105, in __set__
File "libprs500\ebooks\metadata\opf.pyo", line 402, in set_series_index
File "libprs500\ebooks\metadata\opf.pyo", line 167, in _set_metadata_element
File "xml\dom\minidom.pyo", line 1923, in parseString
File "xml\dom\expatbuilder.pyo", line 940, in parseString
File "xml\dom\expatbuilder.pyo", line 223, in parseString
ExpatError: not well-formed (invalid token): line 23, column 32
This is from "Crown Of Slaves", from the free Baen book library. I had no problem loading this book into 4.25, so I've gone back to that.
Jason
kovidgoyal 12-25-2007, 11:17 PM This bug has already been fixed in svn. Unfortunately I'm too busy to release a new version at the moment.
JSWolf 12-26-2007, 12:14 AM Those darned holidays. We really need to do something about them so we can get our software updates.
:rofl:
kovidgoyal 12-26-2007, 01:20 PM Actually it's work that's keeping me busy, but I feel your pain ;-)
vinniet 12-29-2007, 01:41 PM Ive been trying to run libprs500 on vista 32 for my prs-505 and its not working. I followed the directions (uninstall drivers etc) and libprs installs fine. When I run it with my reader connected via usb, the program freezes up and my mouse cursor goes crazy.
I have the same problem as the user above with the mouse, except I can use the program. My mouse goes crazy jumping around. The mouse I am using a USB mouse and I thought it had something to do with the USB drive it trys to install. I uninstalled and reinstalled without the driver but I still have the problem. Any ideas?
kovidgoyal 12-29-2007, 02:48 PM Hmm i'll see if i can replicate this behavior
vinniet 12-29-2007, 04:13 PM Hmm i'll see if i can replicate this behavior
I loaded it on to another machine and I have no problems. Not sure why but I think it has to do with the usb driver since the other machine has a PS2 mouse. Also it could be a conflict to some other USB device ... I have lots of them.
kovidgoyal 12-29-2007, 08:57 PM Hmm there are similar reports on OS X, unfortunately I'm travelling till the 6th, so you'll have to wait.
vinniet 01-01-2008, 07:35 PM I loaded it on to another machine and I have no problems. Not sure why but I think it has to do with the usb driver since the other machine has a PS2 mouse. Also it could be a conflict to some other USB device ... I have lots of them.
Ok I limited it down to the USB mouse. I installed this on a laptop that has internal mouse which is PS2. When I launch libprs500 and use the USB mouse it jumps around. When I use the PS2 mouse, nothing. It seems the software is looking for reader (maybe) on the USB on a interval and it is messing with the USB mouse.
kovidgoyal 01-01-2008, 08:26 PM Yeah that's most probably it, but the polling happens at 1 second intervals, so it seems weird that it should mess up the mouse, but I'll look into it when I return.
kovidgoyal 01-07-2008, 07:17 PM I can't reproduce this issue on any of my machines. USB mice work fine for me with libprs500 running.
kovidgoyal 01-09-2008, 02:27 PM I've changed the way device detection is done, hopefully that will fix this issue. When the next version 0.4.33 is released please test.
Mitchll 01-10-2008, 08:52 AM Kovid,
I just installed 4.33 and the program doesn't find my prs-500. I uninstalled .33, uninstalled the usb drivers, rebooted and reinstalled, but the same result...no reader found!
Mitch:help:
kovidgoyal 01-10-2008, 10:34 AM Looks like the new device detection code causes problems with the PRS500 on windows. I no longer have mine to test with, so could you do the following:
Install python 2.5 from http://python.org/ftp/python/2.5.1/python-2.5.1.msi
Then install the (python win32 extensions) from https://sourceforge.net/project/downloading.php?group_id=78018&filesize=4351705&filename=pywin32-210.win32-py2.5.exe&12384980
Finally download the attached file to some directory on your computer.
Now open a terminal ad type the following command to start python
c:\Python25\python.exe
Now at the python prompt, with your PRS500 connected, type the following lines, line by line
import wmi, pythoncom
pythoncom.CoInitialize()
w = wmi.WMI()
devices = [c.Dependent.DeviceID.upper() for c in w.USBControllerDevice()]
for d in devices: print d
Sorry for the runaround
And post the output of the print statement
JSWolf 01-10-2008, 11:11 AM I have Python 2.5 installed. Would it help to have Python 2.5.1 installed?
kovidgoyal 01-10-2008, 11:14 AM It should be fine with 2.5
Mitchll 01-10-2008, 04:46 PM Kovid:
Not sure I know what I'm doing, but this is surely not what you wanted:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Mitch.B7D7B1B2CFEC4A4>c:\Python25\python.exe
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wmi, pythoncom
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named wmi
>>> pythoncom.CoInitialize()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'pythoncom' is not defined
>>> w = wmi.WMI()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'wmi' is not defined
>>> devices = [c.Dependent.DeviceID.upper() for c in w.USBControllerDevice()]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'w' is not defined
>>> for d in devices: print d
...Looks like the new device detection code causes problems with the PRS500 on windows. I no longer have mine to test with, so could you do the following:
Install python 2.5 from http://python.org/ftp/python/2.5.1/python-2.5.1.msi
Then install the (python win32 extensions) from https://sourceforge.net/project/downloading.php?group_id=78018&filesize=4351705&filename=pywin32-210.win32-py2.5.exe&12384980
Finally download the attached file to some directory on your computer.
Now open a terminal ad type the following command to start python
c:\Python25\python.exe
Now at the python prompt, with your PRS500 connected, type the following lines, line by line
import wmi, pythoncom
pythoncom.CoInitialize()
w = wmi.WMI()
devices = [c.Dependent.DeviceID.upper() for c in w.USBControllerDevice()]
for d in devices: print d
Sorry for the runaround
And post the output of the print statement
kovidgoyal 01-10-2008, 04:56 PM Try copying the wmi.py file to C:\Python25\Lib\site-packages first
Mitchll 01-10-2008, 05:29 PM Try copying the wmi.py file to C:\Python25\Lib\site-packages first
done; but I don't think I know what I'm doing:
import wmi, pythoncom
pythoncom.CoInitialize()
w = wmi.WMI()
devices = [c.Dependent.DeviceID.upper() for c in w.USBControllerDevice()]
for d in devices: print d
typed in but nothing...
Mitchll 01-10-2008, 05:30 PM Full screen at command prompt
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Mitch.B7D7B1B2CFEC4A4>c:\python25\python.exe
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wmi, pythoncom
>>> pythoncom.CoInitialize()
>>> w=wmi.WMI()
>>> devices=[c.Dependent.DeviceID.upper() for c in w.USBControllerDevice()]
>>> for d in devices: print d
...
kovidgoyal 01-10-2008, 05:31 PM After the print statement you need to press enter a few times until it produces some output
Mitchll 01-10-2008, 05:41 PM AHA!!
...
USB\ROOT_HUB\4&2EB90B27&0
USB\VID_046D&PID_C506\5&10C49584&0&1
HID\VID_046D&PID_C506\6&2586256D&0&0000
USB\VID_046D&PID_0B04\5&10C49584&0&3
USB\VID_046D&PID_C713\0007617215A8
HID\VID_046D&PID_C713\7&29068228&0&0000
USB\VID_046D&PID_C714\0007617215A8
HID\VID_046D&PID_C714&COL01\7&377F3F51&0&0000
HID\VID_046D&PID_C714&COL02\7&377F3F51&0&0001
HID\VID_046D&PID_C714&COL03\7&377F3F51&0&0002
HID\VID_046D&PID_C714&COL04\7&377F3F51&0&0003
HID\VID_046D&PID_C714&COL05\7&377F3F51&0&0004
HID\VID_046D&PID_C714&COL06\7&377F3F51&0&0005
HID\VID_046D&PID_C714&COL07\7&377F3F51&0&0006
USB\ROOT_HUB\4&1BFF5A82&0
USB\VID_054C&PID_029B\5&309E88B9&0&3
USB\ROOT_HUB20\4&53D9397&0
>>>
kovidgoyal 01-10-2008, 06:05 PM OK I've rebuilt the installer with a bug fix. Re-install and test.
Mitchll 01-10-2008, 06:43 PM Back on track.
:thanks:
Thanks once again for a great program.
Mitch
Custom 01-13-2008, 08:16 AM Hi few days ago finally I've received the prs-505.
I installed libprs500 some week ago and it has worked fine.
But now, after installing the sony device manager it doesn't work anymore.
Maybe I have to uninstall the drivers? But what kind of drivers, when I've plug in the device Windows has recognized it immediately like an external disk.
Here is the log:
Traceback (most recent call last):
File "main.py", line 827, in <module>
File "main.py", line 816, in main
File "main.py", line 154, in __init__
File "libprs500\gui2\library.pyo", line 405, in set_database
File "libprs500\gui2\library.pyo", line 125, in set_database
File "libprs500\library\database.pyo", line 741, in __init__
File "libprs500\library\database.pyo", line 602, in create_version1
sqlite3.OperationalError: database schema has changed
Traceback (most recent call last):
File "main.py", line 827, in <module>
File "main.py", line 816, in main
File "main.py", line 154, in __init__
File "libprs500\gui2\library.pyo", line 405, in set_database
File "libprs500\gui2\library.pyo", line 125, in set_database
File "libprs500\library\database.pyo", line 741, in __init__
File "libprs500\library\database.pyo", line 602, in create_version1
sqlite3.OperationalError: table books already exists
I've checked some ticket and found that maybe i should cancel library1.db. So I've done it, i've uninstalled the app, removed any registry key from it and then reinstalled the libprs.
But nothing, it doesn't want to work.
kovidgoyal 01-13-2008, 11:07 AM That's a definite problem with the library file. Are you sure you deleted library1.db? Try doing a search on your system for that filename and see if it has any matches. Also did you change the location of the library1.db file through the config dialog of libprs500?
Custom 01-13-2008, 07:02 PM I've found one in the root. I've cancelled it, as at the first attemp that failed, but this time everything seems to work. I don't know why, but I am happy of it.
Thanks for your job! :)
vinniet 01-19-2008, 09:38 PM Ok I limited it down to the USB mouse. I installed this on a laptop that has internal mouse which is PS2. When I launch libprs500 and use the USB mouse it jumps around. When I use the PS2 mouse, nothing. It seems the software is looking for reader (maybe) on the USB on a interval and it is messing with the USB mouse.
Hello ... This has been fixed with the latest version of libprs500 (4.33). It mouse no longer jumps around on my laptop. Thank!!
What other bugs are in this new version?
shousa 01-28-2008, 08:10 PM I have 3 questions:
(1) I have some .rtf files - is there some reason or limitation with .rtfs that would make it better to change these to .lrf or is .rtf fine?
(2) if I have an ebook in the libprs500 database as both a .rtf and a .lrf which one gets transferred to the reader or do both get transferred?
(3) Once I have converted a .lit to a .lrf should I disconnect the .lit from the database?
I think you can see what I am getting at with these questions.
kovidgoyal 01-28-2008, 08:19 PM (1) not really, though I like the fact that I can adjust base font size in LRF files
(2) LRF
(3) No
shousa 01-28-2008, 09:06 PM (1) not really, though I like the fact that I can adjust base font size in LRF files
(2) LRF
(3) No
Thanks a bunch! :thanks:
shousa 01-30-2008, 03:39 AM My library1.db is around 150MBs even though I deleted two .rtfs that were around 40MB from within the GUI.
In the library1.db are there only .lrfs and the rest are links to the hardrive (for locations of .rtf and .lit files - I am almost positive this is not the case)?
or....
is it likely I need to run a repair and compact utility? - is there a link for one?
kovidgoyal 01-30-2008, 10:59 AM library1.db keeps RTFs and LITs in the database as well. When you delete things from a database, free space is not necessarily recovered. The next version of libprs500 will have a compact database button in the config dialog.
astrodad 02-01-2008, 10:23 AM FYI, the link to the new version is down.
https://libprs500.kovidgoyal.net/downloads/libprs500-0.4.35.dmg
kovidgoyal 02-01-2008, 11:47 AM Fixed.
astrodad 02-01-2008, 10:13 PM Sweet. Now to update from SVN as I continue to tinker.
Mitchll 02-04-2008, 09:55 AM Kovid,
I received the following error message in saving to disk a group of books:
[Errno 2] No such file or directory: u'H:/Stasheff, Christopher\\A Wizard In Mind _ The First Chronicle of Magnus D_Armand, Rogue Wizard (Chronicles of the Rogue Wizard)\\A Wizard In Mind _ The First Chronicle of Magnus D_Armand, Rogue Wizard (Chronicles of the Rogue Wizard) - Stasheff, Christopher_1788.lit'
Detailed traceback:
Traceback (most recent call last):
File "main.py", line 528, in save_to_disk
File "libprs500\gui2\library.pyo", line 144, in save_to_disk
File "libprs500\library\database.pyo", line 1325, in export_to_dir
IOError: [Errno 2] No such file or directory: u'H:/Stasheff, Christopher\\A Wizard In Mind _ The First Chronicle of Magnus D_Armand, Rogue Wizard (Chronicles of the Rogue Wizard)\\A Wizard In Mind _ The First Chronicle of Magnus D_Armand, Rogue Wizard (Chronicles of the Rogue Wizard) - Stasheff, Christopher_1788.lit'
Thanks again,
Mitch
kovidgoyal 02-04-2008, 12:14 PM Maybe because of the ( ) Try removing them from the title and then saving
andinho 02-05-2008, 05:33 AM Hi Kovid,
I had a little issue with the image libprs takes from a pdf. It's mirrored upside down. I don't know if that was already mentioned. This almost always happens.
I updated from 0.4.31 to 0.4.35 but the mirroring is still there. Now since 0.4.35 the weird german chars for direct speed (looks like >> <<) are converted into two strangelooking characters like a f and a t. Back to 0.4.31 it's ok again.
Thanks for your program
Andi
kovidgoyal 02-05-2008, 12:06 PM Yeah the rotated images are a bug in pdftohtml, I've informed the authors about it, hopefully, it will get fixed. There is a regression in 0.4.35 on character encodings in PDF, already fixed in svn.
andinho 02-05-2008, 12:21 PM Thanks Kovid. I also found a few examples with missing german umlauts, do you need one?
Andi
kovidgoyal 02-05-2008, 12:24 PM Wait till the next release, if it isn't fixed there, open a ticket.
keith 02-07-2008, 07:38 PM On a computer running Windows XP, Libprs500 0.4.35, trying to change database location when I hit the browse button and select a location (other than the root of the drive) I get the following message:
Invalid database location.
Cannot write to E:/Documents and Settings/Keith/My Documents
If however I 'make new folder' (eg E:\Documents and Settings\Keith\My Documents\Libprs500 database files) in the browse dialogue box then the new folder becomes the new database location without a problem except for the following message:
[Error 2] The system cannot find the file specified: u'C:\\Users\\Keith\\library1.db
I've worked round the problem but wasn't sure whether I was doing something wrong or there is a bug.
kovidgoyal 02-07-2008, 08:00 PM Both those bugs are now fixed in svn.
keith 02-07-2008, 09:22 PM Great, thanks.
johnyboy 02-09-2008, 03:07 AM Hi guys,
just got my prs-505 and am very interested in getting hold of a copy of the newly ported libprs50x. Where can I get this?
thanks in advance
iacchi 02-09-2008, 05:32 AM https://libprs500.kovidgoyal.net/
keith 02-19-2008, 04:40 AM I love the new option in 0.4.37 to save files to a single directory. However it seems the subdirectories are still created as normal though they are empty. So, for example, saving Novel by John Smith into a folder causes the creation of subfolders for Smith; John and under that Novel.
kovidgoyal 02-19-2008, 02:04 PM oops fixed in svn
OUTATIME 03-06-2008, 01:33 PM What's the .opf file that Libprs also creates?
kovidgoyal 03-06-2008, 01:39 PM http://libprs500.kovidgoyal.net/user_manual/gui.html#save_to_disk
OUTATIME 03-06-2008, 02:31 PM Thank you
mazzeltjes 03-06-2008, 03:15 PM Hi Kovid
I downloaded
0.4.41
and now when I try to do a batch conversion I get:
and lib freezes up
:blink::blink::blink:
1 by 1 conversion works
kovidgoyal 03-06-2008, 03:46 PM Oops nasty little bug, I'll release 0.4.42 later today to fix this.
mazzeltjes 03-06-2008, 04:05 PM :thanks::thanks:
Hello there, Kovid.
Just a stupid question.
Is there a reason why LibPRS doesn't stay maximized. Whenever I open it it appears displaced down and right and I have to center it to show the button and then maximize it.
Is it just me?
Thanx for all your work, man.
Hello there, Kovid.
Just a stupid question.
Is there a reason why LibPRS doesn't stay maximized. Whenever I open it it appears displaced down and right and I have to center it to show the button and then maximize it.
Is it just me?
Thanx for all your work, man.
kovidgoyal 03-07-2008, 03:15 PM What operating system is this on?
kovidgoyal 03-07-2008, 03:40 PM Hmm will be fixed in the next release.
andinho 03-15-2008, 03:51 PM Hi Kovid,
can I control how the cover image is extracted from a pdf file? I have a mix of cover image on first or on second page in the lrf file (first page is empty then).
Not a big thing but the Sony software would show the cover of the book which is a bit nicer.
Thanks a lot
Andinho
kovidgoyal 03-15-2008, 03:57 PM You can convert to HTML first using pdftohtml (its what pdf2lrf does under the hood), change the HTML to whatever you want and then run html2lrf on it.
torbich 03-18-2008, 02:51 AM Hi Kovid,
I tried to install libprs500 on WinXP Pro SP2 (Russian) system, and it doesn't start after clicking its icon. No messages, no errors, no result. Tried several versions - same result. Where can I look for some logs to find what is the problem? I suppose no additional software required?
kovidgoyal 03-18-2008, 12:24 PM Try running it in a terminal (libprs500.exe)
torbich 03-18-2008, 02:35 PM Try running it in a terminal (libprs500.exe)
Tried this also. No messages, 3-4 seconds of HDD working and no GUI, nothing.
kovidgoyal 03-18-2008, 04:05 PM Download and install libprs500 from http://theory.caltech.edu/~kovid/libprs500-0.4.42.exe
Try to run the GUI. If it fails, post the contents of libprs500.log (it will be somewhere under Documents and Settings
torbich 03-18-2008, 04:59 PM Download and install libprs500 from http://theory.caltech.edu/~kovid/libprs500-0.4.42.exe
Thank you very much! Started libprs500-debug and found the source of the problem: my username has Cyrillic characters in it, that's why I got
File "ntpath.pyo", line 368, in expanduser
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 26: ordinal not in range(128)
so I need to set 2 environments variables: PYTHONPATH and HOME. Problem completely solved.
The Old Man 03-24-2008, 04:16 PM Today, after a couple of tries, I notice that the Fetch News in libprs500 for the Jerusalem Post picks up nothing more than the TOC.
Is this because of a change in the JP feeds or a problem with libprs500?
kovidgoyal 03-24-2008, 04:22 PM Works for me. What OS are you running on?
The Old Man 03-24-2008, 04:36 PM Works for me. What OS are you running on?
Strange, just tried it again with the same problem.
I'm running Windows XP Pro. 4 gig memory. Same machine that it has worked on until today. I did install the latest MS security update.
Just rebooted the machine and tried it again - :angry:
kovidgoyal 03-24-2008, 04:58 PM It's a windows only thing, will be fixed in the next release.
The Old Man 03-24-2008, 05:04 PM It's a windows only thing, will be fixed in the next release.
Thanks, I was sure my OLD (2 1/2 year) computer was at fault or else the MS update crippled it. Sometimes I think civilization is ok - it just has gone on too long.:smack:
The Old Man 03-27-2008, 11:18 AM Back to version 4.2.
With version 4.4 The New York Times loaded OK, started OK but when I used the + key to enlarge the font the Reader re-booted itself. This happened twice.
With the Jerusalem Post it happened once (re-booted) and then was OK.
No problem with Newsweek.
kovidgoyal 03-27-2008, 01:54 PM Yeah the reader rebooting thing is unfortunate. As far as I can tell, it happens because SONY's reader software simply can't handle the new news LRF's. Not really sure what I can do about that, other than hope SONY fixes it in the next firmware upgrade.
The Old Man 03-27-2008, 02:44 PM Yeah the reader rebooting thing is unfortunate. As far as I can tell, it happens because SONY's reader software simply can't handle the new news LRF's. Not really sure what I can do about that, other than hope SONY fixes it in the next firmware upgrade.
0.4.42 seems to work without that problem. I have not tried all the news sources.
kovidgoyal 03-27-2008, 02:55 PM Yeah but 0.4.42 used the old framework, which was a lot less powerful, no navigation bar, no support for pictures in a lot of the feeds, etc. The new framework has all those features, but it seems to push the limits on the SONY software for some feeds.
JSWolf 03-27-2008, 03:40 PM So why not just set the base font to what you want and just keep it at small?
The Old Man 03-27-2008, 04:40 PM So why not just set the base font to what you want and just keep it at small?
Well, you probably know something I don't.
I have changed the font size (larger) under Convert E-Books/Set conversion defaults, but it seems to make no difference in the News feeds. These tired old eyes have to make the font larger. Is there some other way to enlarge the font in the Feeds (Fetch News)?
kovidgoyal 03-27-2008, 04:58 PM The conversion defaults dont affect news downloads, if you want to set the base font size larger you have to run the news downloads from the command line, or create a custom recipe based on the built-in ones that bumps up the font-size
The Old Man 03-27-2008, 05:09 PM The conversion defaults dont affect news downloads, if you want to set the base font size larger you have to run the news downloads from the command line, or create a custom recipe based on the built-in ones that bumps up the font-size
Thanks, Kovid. I was afraid the answer would be something like that.
I am too dumb, too lazy or both to do that. :eek:
Any chance you could put a change-font-size for News feeds in the GUI as you have done for Covert E-books?
JSWolf 03-27-2008, 05:19 PM I have never used Libprs500 to convert anything via the GUI. Just more hassle then the command line.
kovidgoyal 03-27-2008, 06:28 PM Thanks, Kovid. I was afraid the answer would be something like that.
I am too dumb, too lazy or both to do that. :eek:
Any chance you could put a change-font-size for News feeds in the GUI as you have done for Covert E-books?
That's kinda hard to do because different feeds need different base font sizes. It would take a while to implement. What I have done in the meantime is bumped up the default font size for the nytimes by 4pts (equivalent to the L size)
The Old Man 03-27-2008, 06:39 PM That's kinda hard to do because different feeds need different base font sizes. It would take a while to implement. What I have done in the meantime is bumped up the default font size for the nytimes by 4pts (equivalent to the L size)
Thank you. I'll give it a try. I use M size for almost everything, including books. The S is just too small.
The Old Man 03-28-2008, 08:24 AM That's kinda hard to do because different feeds need different base font sizes. It would take a while to implement. What I have done in the meantime is bumped up the default font size for the nytimes by 4pts (equivalent to the L size)
Version 4.5 under Windows XP Pro:
The New York Times will not show with the View option. It goes to 54% and then just stops.
When loading it into the the 505 the Reader reboots when selecting the NYT to read, However the second time I tried it (after the first re-boot) it worked.
kovidgoyal 03-28-2008, 01:58 PM Yeah the reader requires one reboot to handle the file. Nothing I can do about that, since there's nothing actually wrong with the file. It works fine for me in the libprs500 viewer though
The Old Man 03-29-2008, 09:51 AM Yeah the reader requires one reboot to handle the file. Nothing I can do about that, since there's nothing actually wrong with the file. It works fine for me in the libprs500 viewer though
Kovid,
Thank you for all your efforts!
Using version 4.46 I find the fonts very satisfactory in Fetch news. Some probably think them a bit large, but overall I am very pleased.
This morning I “fetched” The New York Times, The Jerusalem Post, Newsweek, NASA, The Atlantic, The Economist, Google Reader and NYR Book Review. Then I switched back and forth between them. Occasionally the Reader went into a reboot (as you say, unavoidable) and then continued normally.
Is this reboot a function of Sony’s memory? I suspect that it is as, for example, the NASA feed forced a reboot the first time I ran it but not the second. Switching to several of the other feeds a reboot was necessary at The Economist. Then returning to NASA there was no reboot. In other words it appears that the reboot occurs when the 505 says “full up.” – Just a guess. Would using a memory card help this? I currently have no memory card installed and libprs500 shows about 120 mb free.
Your program has made my 505 worth twice as much as I paid for it so I have made another small donation. I hope others are doing the same.
I almost bought the Amazon Kindle because of the magazine and newspaper feeds but considering they are extra cost on the Kindle and free with the Sony and libprs500 and getting several feeds that Amazon doesn’t offer is a big plus. Thanks, again.
kovidgoyal 03-29-2008, 10:09 AM I suspect it is a memory leak in the LRF reader software. Basically when formatting large/complex files it needs a lot of memory and not all of this memory is released when the formatting process is completed.
Your donation is much appreciated.
sigmax 04-11-2008, 03:31 PM HI!
I just bought my sony prs-505, still waiting for it to arrive (a friend of mine brings it from USA on april 23rd, as I live in South America).
I found Kovidgoyal's work quite cool, and I was drooling all over the idea of using libprs500 with the soon-to-be-in-my-hands prs-505 ...
So I downloaded and installed it (version 0.4.49).
I find most of the interfase text / windows / options in german (?) and French(?) and only some (few) labels in english.
So I dont know what am I doing. Is this correct ? it is only happening to me ? I already searched this thread for "german" instances, but only found two unrelated posts ...
Just in case, I am using a windows XP professional / service pack 2, latest patches and aditions in place, in SPANISH.
Regards,
Enrique.
kovidgoyal 04-11-2008, 09:48 PM weird, try setting the LANGUAGE environment variable to es. A quick google will tell you how to set environment variables in windows.
sigmax 04-11-2008, 10:20 PM Hi!
Thanks for your suggestion! I always assumed that in windows XP, language settings are done in the control panel, under the Regional Settings CPL.
I got, in there, in all the related / relevant selectors, SPANISH as language, URUGUAY as country.
I cannot find any other language environment settings.
I googled for it, with no luck.
It may be important to tell that I got lots of applications installed in my notebook, and this is the only application that have such polyglote mix.
If I can be of any help, please let me know. I attached a screen capture showing main labels in spanish, some default text in textbox in german, and a floating window in french, as I try to import some books ...
I am a programmer (.net framework) ... if there is anything I can do for help, just tell me: I´ll gladly try.
Enrique
kovidgoyal 04-11-2008, 10:28 PM Ah you misunderstood you have to set an environment variable, like the PATH environment variable. The name of this variable is LANGUAGE or LANG and its value should be es for Spanish.
I'm not sure why you're seeing a polyglot of UI strings. Try running the libprs500-debug.exe program. That should give you a prompt. At the prompt execute the following code:
import locale
print locale.getdefaultlocale()
sigmax 04-11-2008, 10:42 PM Hi Kovid,
Thx for your quick response. This is what I get (which seems ok with my settings):
In [1]: import locale
In [2]: print locale.getdefaultlocale()
('es_UY', 'cp1252')
In [3]:
Let me try the variable trick:
Y added LANGUAGE=es and LANG=es both in user and system environment variables, and I still get the language mix. I also tried other windows in librs500, like the one that lets you set the default values for converting books into mobile format, and it also is in language mix.
Weird enough! If I only knew German or French, I Could still use the application. It seems that "es_UY" (cp1252) mixes up something ... it seems to be beyond your own code, if you ask me: More on the side of a bug in the interpreter / compiler of the language you use. I mean, I assume that you are not checking and placing the correct language in EACH label, but set it up as a localization issue at the beginning.
BUT I do not get "the whole thing in one language" but bits in each language. Weird.
Also, this is my own interpretation of where the problem could be (and maybe I just typed a big nonsense :D
Seriously: I hope you can fix it. Please let me know about any test you want me to perform,
Enrique.
kovidgoyal 04-11-2008, 11:05 PM Looks like the es translation file contains german and french strings. You can use the application by setting LANGUAGE to en to get english.
If you dont want to have it set globally just create a .bat file that sets it and then launches libprs50. I'll fix the translation file for the next release
sigmax 04-11-2008, 11:14 PM If you want me to do some translations, I am OK with English-Spanish languages, just tell me what file should I dig :)
Time for me to do some sleeping ... !
Regards, Enrique.
kovidgoyal 04-11-2008, 11:18 PM No I just checked, the es file is fine and it works for me on linux. Strange. Which strings in particular are appearing in german/french?
kovidgoyal 04-11-2008, 11:20 PM There's a translations howto at http://libprs500.kovidgoyal.net/wiki/Development#Translations if you're interested in completing the spanish language file.
sigmax 04-12-2008, 12:55 PM Hi!
You can see a bunch of them in the screen capture I sent. In almost every window, there are mixes in language... Maybe you could in a future release, place a manual override language selector, or something like that, instead letting the localizing routines do the automatic job ? Something weird is going on inside them, for sure :)
Regards,
Enrique
kovidgoyal 04-12-2008, 10:13 PM Unfortunately, I don't recognize Spanish well enough to tell which of those strings are spanish and which not. But adding a config option to select the UI language is a good idea, please open a ticket for it, and I'll implement it when I get some time.
iacchi 04-13-2008, 04:28 AM The same appened for italian, before my translation. Our UI was half in Spanish, half in German.
kovidgoyal 04-13-2008, 09:51 PM Hmm I'll have to look into this when I get some time. Problem is I have a hard time since I don't really recognize strings in the various european languages.
astrodad 04-16-2008, 11:16 AM Kovid,
I am doing development (learning) on Ubuntu and I am able to get the app to run inside PyDev, but none of my UI changes take affect. If I make a change in a .UI file and run it, none of the changes show up. Do I need to compile the UI files separately some how?
gwynevans 04-16-2008, 12:18 PM Try a "make" or "make gui" at the top level?
astrodad 04-16-2008, 08:41 PM That worked. I thought I could run it within Eclispe and see the changes. Is that true only for the UI files? I thought since Python was an interpreted language I could just change the text files.
astrodad 04-17-2008, 01:59 PM Well it works so I am not complaining. One thing that is weird is that I cannot save the preferences in the config dialog and I'm not getting any errors. If I make a change in the config GUI, hit OK, and go back. It's there. But when I close the app and re-open, the preferences are not saved. This happens from within PyDev and from the command line.
kovidgoyal 04-18-2008, 06:01 AM You just need to run "make test" in the gui2 directory. You can setup a run profile in eclipse to run it automatically. The GUI is stored in XML files, which is why they need to be compiled. Not sure why you cant store settings in pydev though.
astrodad 04-18-2008, 02:20 PM I've implemented the dialog to accept a standard set of default tags, but there are a couple of glitches. I've also added code to take the value from preferences when importing a new book.
1. I can't save the preference for some reason.
2. The tag editor expects a row index for the book being edited so it can preload the existing tags but obviously in this case there is no real 'book' since we're talking about the defaults. Do you think I should make a version of the TagEditor that doesn't need the row parameter and instead receives the existing string from the dialog?
3. Even though I specify the value when adding a book, they don't get stored. I'll have to play with it some more.
I'm having fun learning the Python code. The white space thing keeps getting me ;)
kovidgoyal 04-19-2008, 12:21 AM 1. Don't really know. Perhaps you should try the eclipse forums?
2. A cleaner solution would be to store the default tags in a Settings object (since they're user settings and the database is not really designed to handle that. You could just subclass the TagEditor class and override the API. Use the get and set methods on the Settings object to read/store default tags.
3. Not sure what you mean, can you elaborate?
astrodad 04-22-2008, 03:21 PM Kovid,
I've created a new class called DefaultTagEditor and I think I have the right code to implement TagEditor so that I can override the _init_ to change the way it reads the existing tags. I'm getting an error, though. Here's the code:
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.QtGui import QDialog, QMessageBox
from libprs500.gui2.dialogs.tag_editor_ui import Ui_TagEditor
from libprs500.gui2 import qstring_to_unicode
from libprs500.gui2 import question_dialog, error_dialog
from libprs500.gui2.dialogs import TagEditor
class DefaultTagEditor(QDialog, Ui_TagEditor, TagEditor):
def __init__(self, window, db, tagStrings):
QDialog.__init__(self, window)
Here's the error:
Traceback (most recent call last):
File "/home/javier/workspace/libprs500/src/libprs500/gui2/main.py", line 34, in <module>
from libprs500.gui2.dialogs.config import ConfigDialog
File "/home/javier/workspace/libprs500/src/libprs500/gui2/dialogs/config.py", line 12, in <module>
from libprs500.gui2.dialogs.default_tag_editor import DefaultTagEditor
File "/home/javier/workspace/libprs500/src/libprs500/gui2/dialogs/default_tag_editor.py", line 9, in <module>
from libprs500.gui2.dialogs import TagEditor
ImportError: cannot import name TagEditor
astrodad 04-22-2008, 03:50 PM OK, ignore the last post. I figured that out. I think I'm almost there.
kovidgoyal 04-22-2008, 09:22 PM That's great.
astrodad 04-23-2008, 10:00 AM One thing that's interesting. In trying to use my new DefaultTagEditor, I get an error when the accept runs. Here's what happens:
Traceback (most recent call last):
File "/home/javier/workspace/libprs500/src/libprs500/gui2/dialogs/config.py", line 106, in edit_defaultTags
tag_string = ', '.join(d.tags)
TypeError: sequence item 0: expected string, QString found
Here's the code that invokes the default tag editor:
def edit_defaultTags(self):
d = DefaultTagEditor(self, self.db,self.defaultTags.text())
d.exec_()
if d.result() == QDialog.Accepted:
tag_string = ', '.join(d.tags)
self.defaultTags.setText(tag_string)
I didn't change anything about the tag editor except that I changed the init to not look for the existing tags from a book, but from the Settings object. Any ideas?
Here's the new editor code:
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.QtGui import QDialog, QMessageBox
from libprs500 import islinux, Settings
from libprs500.gui2.dialogs.tag_editor_ui import Ui_TagEditor
from libprs500.gui2 import qstring_to_unicode
from libprs500.gui2 import question_dialog, error_dialog
from libprs500.gui2.dialogs.tag_editor import TagEditor
class DefaultTagEditor(TagEditor):
def __init__(self, window, db, tagStrings):
QDialog.__init__(self, window)
Ui_TagEditor.__init__(self)
self.setupUi(self)
settings = Settings()
self.db = db
self.tags = tagStrings.split(',')
if self.tags:
for tag in self.tags:
self.applied_tags.addItem(tag)
all_tags = [tag.lower() for tag in self.db.all_tags()]
all_tags = list(set(all_tags))
all_tags.sort()
for tag in all_tags:
if tag not in tagStrings:
self.available_tags.addItem(tag)
self.connect(self.apply_button, SIGNAL('clicked()'), self.apply_tags)
self.connect(self.unapply_button, SIGNAL('clicked()'), self.unapply_tags)
self.connect(self.add_tag_button, SIGNAL('clicked()'), self.add_tag)
self.connect(self.delete_button, SIGNAL('clicked()'), self.delete_tags)
self.connect(self.add_tag_input, SIGNAL('returnPressed()'), self.add_tag)
self.connect(self.available_tags, SIGNAL('itemActivated(QListWidgetItem*)'), self.apply_tags)
self.connect(self.applied_tags, SIGNAL('itemActivated(QListWidgetItem*)'), self.unapply_tags)
def apply_tags(self, item=None):
items = self.available_tags.selectedItems() if item is None else [item]
for item in items:
tag = qstring_to_unicode(item.text())
self.tags.append(tag)
self.available_tags.takeItem(self.available_tags.r ow(item))
self.tags.sort()
self.applied_tags.clear()
for tag in self.tags:
self.applied_tags.addItem(tag)
kovidgoyal 04-23-2008, 12:32 PM Use
tags = [qstring_to_unicode(t) for t in d.tags]
astrodad 04-24-2008, 11:22 AM Thanks! I've modified database.py to get the default tags from Settings and then to call set_tags, but here's what's stored:
default tag is test,test2
stored tag: ., 0, 4, 6, <, >, c, l, q, p, s, a, b, e, d, g, i, j, o, n, r, t, y, x, 5, 9
here's the code (i know I need to add a check to make sure we actually have default tags, but I'll do that as soon as I know this works)
settings = Settings()
self.set_tags(id, unicode(settings.value("defaultTags").toString().split(',')) )
kovidgoyal 04-25-2008, 12:17 PM Use the get and set methods on the Settings object (much more python friendly), that should automatically fix this problem. Also as a stylisic note use descriptive phrases for settings, something like "default tags" rather than defaultTags
ligos 05-07-2008, 11:00 AM I downloaded the newest version of libprs500 -0.4.51 ie calibre and it worked-I could fetch the news from built-in recipes as well as my own. But when I started the program next day it failed to fetch any of the news. It shows the following traceback:
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8c in position 113: ordinal not in range(128)
Failed to perform job: Fetch news from FAZ NET
Detailed traceback:
Traceback (most recent call last):
File "parallel.py", line 139, in run_job
File "calibre\ebooks\lrf\feeds\convert_from.pyo", line 40, in main
File "calibre\web\feeds\main.pyo", line 128, in run_recipe
File "calibre\web\feeds\news.pyo", line 810, in __init__
File "calibre\ebooks\lrf\web\profiles\__init__.pyo", line 174, in __init__
File "calibre\ebooks\lrf\web\profiles\__init__.pyo", line 225, in build_index
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8c in position 113: ordinal not in range(128)
Log:
Fetching feeds...
I think I had similar problem with few previous versions(however I do not have any confirmation it is exactly the same-the problem as I recall was with ASCII as well)-as far as I remember from 0.4.46.
Does anybody know how to remove the error?
sigmax 05-07-2008, 12:12 PM Hi Ligos!
I have the same problem as you do, but I could not get it to work since day one. As I try to get a rss feed (any of the included ones in calibre), it takes a lot of time just to report an error like yours stating the ascii thingy.
Nevertheless, if I use the command line, I can get the feed.
Regards,
sigmaX
kovidgoyal 05-07-2008, 09:48 PM @ligos: Try the next release of calibre, it has a bunch of unicode fixes in it. It should be out in a few days.
nomedia 05-12-2008, 06:46 PM I installed calibre in my window and get this message, as I get the similar ones from ubuntu. Maybe it is from my device?
ExpatError: not well-formed (invalid token): line 1, column 0
Failed to perform job: Get metadata from device
Further device related error messages will not be shown while this message is visible.
Detailed traceback:
Traceback (most recent call last):
File "calibre\gui2\jobs.pyo", line 64, in run
File "calibre\gui2\device.pyo", line 81, in books
File "calibre\devices\prs505\driver.pyo", line 293, in books
File "calibre\devices\prs505\books.pyo", line 134, in __init__
File "xml\dom\minidom.pyo", line 1913, in parse
File "xml\dom\expatbuilder.pyo", line 928, in parse
File "xml\dom\expatbuilder.pyo", line 207, in parseFile
ExpatError: not well-formed (invalid token): line 1, column 0
kovidgoyal 05-12-2008, 06:50 PM Try deleting the file media.xml, disconnecting the device and then once it has finished processing re-connecting it.
nomedia 05-12-2008, 06:57 PM Where is the file?
Thanks for your quick reply
nomedia 05-12-2008, 06:58 PM I found it!
nomedia 05-12-2008, 07:18 PM However, after deleting that file, calibre doesn't recognize the device, not displaying the reader.
kovidgoyal 05-12-2008, 07:25 PM after deleting disconnect the device, let it regenerate the file and then re-connect it.
nomedia 05-12-2008, 07:58 PM It has regenerated the file, but still calibre doesn't recognize the reader.
kovidgoyal 05-12-2008, 07:59 PM reboot
Hello Kovid,
Probably someone asked this before, but I can't seem to find it. There are two reasons to use Sony's ebook library, the store and the pre-pagination. I don't buy books from there, so the only reason for me not to stick exclusively to Calibre is the pre-pagination, that takes sometimes up to 10 minutes on the Reader.
Can you arrange it so Calibre manages the pre-pagination so we Calibre users can discard the ebook library?
Thanks, man.
kovidgoyal 05-17-2008, 11:19 AM Unfortunately doing that is highly non-trivial since in order to succeed, calibre would have to reproduce the rendering algorithm of the reader software exactly. Doing that by reverse engineering is not easy.
ligos 05-17-2008, 07:22 PM Kovid,
I know that this could be a question out of the blue, but I will ask it(maybe it was asked before?). The matter is with podcast-they are most often distributed by RSS. Does Calibre have the capability to deal with music in similar way as it handles text(or possibly could have in some future time) so that the created files could be listened on PRS?
kovidgoyal 05-17-2008, 07:27 PM It's not on my radar, but patches are always welcome :)
Ups!
Would there be a way to make Calibre launch the ebook library, export the file, pre-paginate, import back and close the ebook library, all of this on the background?
The use should give Calibre the direction to the library .exe and then press a button for pre-pagination.
This is probably nonsense, but my Knowledge of programing is next to nonexistent.
Thanks in advance for both your answers.
kovidgoyal 05-18-2008, 10:08 AM Only on windows, and I make it a policy to not have platform specific features.
Fair enough. Thanks for your quick responses.
andinho 05-30-2008, 07:10 PM Hi Kovid,
browse by covers uses the full vertical dimension on my MacBook Pro. But down there is the dock, so I can't change size anymore.
Thanks
Andinho
kovidgoyal 05-30-2008, 08:50 PM what is the resolution of your screen? You can use the Esc key at any time to quit the cover browsing mode
andinho 05-31-2008, 05:38 AM It's 1440x900, Kovid. And esc ends browse mode but leaves the window the same size (from top directly under the menu until bottom end of the screen
edit, 1440
costash 06-15-2008, 01:35 PM Hi everyone.
Thank you mr. Kovidgoyal for your great work !!!
I'm using "calibre" to convert HTML files, (encoded with utf-8, so I can keep romanian characters) into LRF, and I'm embedding only 1 serif font.
Everything worked perfectly for me - thanks again - until the upgrades following v.0.4.67.
I don't know what changed there, but since that upgrade, every version of calibre I tried doesn't seem to work for me: it embedds the font I choose, but it doesn't contain diacritics, so instead of "ţ" "Ţ" "ă" "Ă" is nothing.
For now I'm using v.67, but can you please explain me what happened?
Thank you for your interest,
Costi from Romania
:help:
kovidgoyal 06-15-2008, 01:53 PM the font handling changed in 67. Are you sure you're embedding the same font? Which font is it?
costash 06-16-2008, 02:22 AM This is weird...
I'm using only one font at once, but I was testing a lot of them, such as: Times New Roman, Garamond, Palatyno, Arial Narrow, etc.
Now what's really strange is this: what looks OK in .067, doesn't work in .070 !
I attached a zip file with the "htm" file i was using and 2 examples of fonts that work, and 2 that don't.
I'm using XP SP3.
:thanks:
Hello Kovid,
Started having problems with fonts with 70 (would try to get Futura embedded and get different strange results), so I uninstalled and reinstalled 68. Since then, I have tried 68,69 and 70 and when trying to convert anything (even already converted files) I get this:
"list index out of range
Detailed traceback:
Traceback (most recent call last):
File "main.py", line 796, in convert_single
File "calibre\gui2\dialogs\lrf_single.pyo", line 62, in __init__
File "calibre\gui2\dialogs\lrf_single.pyo", line 49, in initialize_common
File "calibre\gui2\dialogs\lrf_single.pyo", line 104, in load_saved_global_defaults
File "calibre\gui2\dialogs\lrf_single.pyo", line 142, in set_options_from_cmdline
IndexError: list index out of range"
Can you help me?
Thanks, man.
kovidgoyal 06-20-2008, 02:44 PM locate and delete the files calibre.ini and calibre2.ini (you will lose all saved settings)
Thanks.
Calibre works again. I tried .72 and had to fall back to .68. There is some sort of problem when embedding Futura. Not to worry, .68 works perfect.
|