Order it now! Amazon prioritizes orders on a first come, first served basis.


View Full Version : libprs500 and memory stick


jplumey
01-14-2008, 11:32 AM
For some reason, libprs500 does not recognize my Memory Stick, even though there are already books on there (from Connect) and the Mac mounts it. I can navigate the contents, but I can't seem to get libprs500 to see it so I can put contents on it.

Any one have a similar problem?

kovidgoyal
01-14-2008, 01:06 PM
Are you using only a memory stick or a card and a memory stick?

jplumey
01-14-2008, 01:08 PM
I am using a 2 GB memory stick and a 2 GB SD card.

kovidgoyal
01-14-2008, 02:49 PM
libprs500 supports only one card at a time.

jplumey
01-14-2008, 03:01 PM
Oh ok. I've downloaded the trunk to take a look at the code. I'm not familiar with Python, but I am very interested in learning. I have a Java/C++/PHP/VB/.NET background. Like I said, I've never used Python before so if I can get my development environment on my Mac working (using Easy Eclipse) then I may play around with it and submit some patches.

This may off topic, but what do you recommend in terms of environment for working with Python on the Mac?

kovidgoyal
01-14-2008, 03:55 PM
I dont use Macs, but eclipse + pydev is a good cross platform python IDE. To get libprs500 running from svn requires a whole bunch of dependencies to be compiled and installed on your system. The list is at https://libprs500.kovidgoyal.net/download_generic

jplumey
01-15-2008, 06:54 PM
Well I haven't had much luck getting to work on my Mac, so I'm trying my work system..shhh... I have pydev running. When I run easy_install-2.5 -U TTFQuery libprs500 && libprs500_postinstall I get:

C:\Source\workspace\python\libpr500>easy_install -U TTFQuery libprs500 && libprs500_postinstall
Searching for TTFQuery
Reading http://pypi.python.org/simple/TTFQuery/
Reading http://ttfquery.sourceforge.net/
Reading https://sourceforge.net/project/showfiles.php?group_id=84080
Reading http://members.rogers.com/mcfletch/
Best match: TTFQuery 1.0.1
Processing ttfquery-1.0.1-py2.5.egg
ttfquery 1.0.1 is already the active version in easy-install.pth

Using c:\python25\lib\site-packages\ttfquery-1.0.1-py2.5.egg
Processing dependencies for TTFQuery
Finished processing dependencies for TTFQuery
Searching for libprs500
Reading http://pypi.python.org/simple/libprs500/
Reading http://libprs500.kovidgoyal.net
Best match: libprs500 0.4.33
Processing libprs500-0.4.33-py2.5.egg
libprs500 0.4.33 is already the active version in easy-install.pth
Installing epub2lrf-script.py script to C:\Python25\Scripts
Installing epub2lrf.exe script to C:\Python25\Scripts
Installing lrf-meta-script.py script to C:\Python25\Scripts
Installing lrf-meta.exe script to C:\Python25\Scripts
Installing lit-meta-script.py script to C:\Python25\Scripts
Installing lit-meta.exe script to C:\Python25\Scripts
Installing pdf-meta-script.py script to C:\Python25\Scripts
Installing pdf-meta.exe script to C:\Python25\Scripts
Installing epub-meta-script.py script to C:\Python25\Scripts
Installing epub-meta.exe script to C:\Python25\Scripts
Installing rtf-meta-script.py script to C:\Python25\Scripts
Installing rtf-meta.exe script to C:\Python25\Scripts
Installing web2lrf-script.py script to C:\Python25\Scripts
Installing web2lrf.exe script to C:\Python25\Scripts
Installing isbndb-script.py script to C:\Python25\Scripts
Installing isbndb.exe script to C:\Python25\Scripts
Installing any2lrf-script.py script to C:\Python25\Scripts
Installing any2lrf.exe script to C:\Python25\Scripts
Installing rtf2lrf-script.py script to C:\Python25\Scripts
Installing rtf2lrf.exe script to C:\Python25\Scripts
Installing pdf2lrf-script.py script to C:\Python25\Scripts
Installing pdf2lrf.exe script to C:\Python25\Scripts
Installing lrf2lrs-script.py script to C:\Python25\Scripts
Installing lrf2lrs.exe script to C:\Python25\Scripts
Installing web2disk-script.py script to C:\Python25\Scripts
Installing web2disk.exe script to C:\Python25\Scripts
Installing html2lrf-script.py script to C:\Python25\Scripts
Installing html2lrf.exe script to C:\Python25\Scripts
Installing markdown-libprs500-script.py script to C:\Python25\Scripts
Installing markdown-libprs500.exe script to C:\Python25\Scripts
Installing libprs500_postinstall-script.py script to C:\Python25\Scripts
Installing libprs500_postinstall.exe script to C:\Python25\Scripts
Installing prs500-script.py script to C:\Python25\Scripts
Installing prs500.exe script to C:\Python25\Scripts
Installing txt2lrf-script.py script to C:\Python25\Scripts
Installing txt2lrf.exe script to C:\Python25\Scripts
Installing lit2lrf-script.py script to C:\Python25\Scripts
Installing lit2lrf.exe script to C:\Python25\Scripts
Installing lrf2html-script.py script to C:\Python25\Scripts
Installing lrf2html.exe script to C:\Python25\Scripts
Installing lrfviewer-script.pyw script to C:\Python25\Scripts
Installing lrfviewer.exe script to C:\Python25\Scripts
Installing libprs500-script.pyw script to C:\Python25\Scripts
Installing libprs500.exe script to C:\Python25\Scripts

Using c:\python25\lib\site-packages\libprs500-0.4.33-py2.5.egg
Processing dependencies for libprs500
Finished processing dependencies for libprs500
Traceback (most recent call last):
File "C:\Python25\Scripts\libprs500_postinstall-script.py", line 8, in <module>
load_entry_point('libprs500==0.4.33', 'console_scripts', 'libprs500_postinstall')()
File "build/bdist.linux-i686/egg/libprs500/linux.py", line 230, in post_install
AttributeError: 'module' object has no attribute 'geteuid'

gwynevans
01-15-2008, 07:22 PM
Did you get all the dependencies installed first - that's where I came unstuck when trying to get things going on Windows (as a Java programmer who dabbles with Python!)

The alternative might be to use the VMware Applicance - I did actually mange to get that working!

jplumey
01-15-2008, 08:22 PM
Well that's where I am stuck. The command 'easy_install -U TTFQuery libprs500 && libprs500_postinstall' is supposed to get all of those isn't it?

kovidgoyal
01-15-2008, 08:23 PM
You don't need the post_install script on OSX, it does only linux specific things. Try running one of the commandline tools say

html2lrf file.html

jplumey
01-15-2008, 08:35 PM
You don't need the post_install script on OSX, it does only linux specific things. Try running one of the commandline tools say

html2lrf file.html


I've moved on to Windows for the time being.

Here's what I get:

C:\Source\workspace\python\libpr500>lrf2html sample.html
Traceback (most recent call last):
File "C:\Python25\Scripts\lrf2html-script.py", line 8, in <module>
load_entry_point('libprs500==0.4.33', 'console_scripts', 'lrf2html')()
File "build/bdist.linux-i686/egg/pkg_resources.py", line 277, in load_entry_point
File "build/bdist.linux-i686/egg/pkg_resources.py", line 2179, in load_entry_point
File "build/bdist.linux-i686/egg/pkg_resources.py", line 1912, in load
File "build/bdist.linux-i686/egg/libprs500/ebooks/lrf/__init__.py", line 30, in <module>
File "build/bdist.linux-i686/egg/libprs500/ebooks/lrf/fonts/__init__.py", line 22, in <module>
ImportError: No module named ImageFont

kovidgoyal
01-15-2008, 08:46 PM
You need to install the python imaging library

jplumey
01-15-2008, 09:06 PM
OK, I installed the imaging library and it works. So once I have the code in Eclipse running PyDev, I need to do what? If I make a change to some code, is there a build process? I am ignorant of Python. I have picked up a book and am going to go through it but I was hoping you could lead me in the right direction so that I can at least "see" what happens when I change things.

kovidgoyal
01-15-2008, 09:10 PM
No build process, just make the change and run the the program. You may find this useful

http://docs.python.org/tut/

gwynevans
01-16-2008, 05:15 AM
Well that's where I am stuck. The command 'easy_install -U TTFQuery libprs500 && libprs500_postinstall' is supposed to get all of those isn't it?

Ah :smack: - must take another look, then! :)

jplumey
01-16-2008, 11:27 AM
I seem to have all of the dependencies and it works from the command line, but not from my IDE. That's my next thing...

kovidgoyal
01-16-2008, 12:56 PM
You have defined a python interpreter in the pydev preferences haven't you?

gwynevans
01-16-2008, 01:17 PM
Something not quite right with mine. Installed OK, but while I can run "python libprs500\devices\prs500\cli\main.py" OK for instance, when I try to pass the "info" command I get "ImportError: No module named wmi".

Similarly, if I run "python libprs500\gui2\main.py", I first got "ImportError: cannot import name question_dialog" but after I did a "python setup.py install" I get a little further & now get "ImportError: No module named tag_editor_ui".

Do either of those commands work for you?

kovidgoyal
01-16-2008, 01:30 PM
@gwynevans

You need to intall wmi for python and its dependencies (google it) Also you have to run python make.py in the gui2 subdirectory.

jplumey
01-16-2008, 02:32 PM
You have defined a python interpreter in the pydev preferences haven't you?

Yes I do. When I try to run from within pydev, this is what I get.

Traceback (most recent call last):
Traceback (most recent call last):
File "C:\Source\workspace\python\libpr500\src\libprs500\ gui2\main.py", line 40, in <module>
from libprs500.gui2.main_window import MainWindow
File "C:\Source\workspace\python\libpr500\src\libprs500\ gui2\main_window.py", line 19, in <module>
from libprs500.gui2.dialogs.conversion_error import ConversionErrorDialog
File "C:\Source\workspace\python\libpr500\src\libprs500\ gui2\dialogs\conversion_error.py", line 17, in <module>
from libprs500.gui2.dialogs.conversion_error_ui import Ui_ConversionErrorDialog
ImportError: No module named conversion_error_ui

kovidgoyal
01-16-2008, 02:42 PM
Run python make.py in the gui2 subdirectory. Is the GUI working from the commandline?

jplumey
01-16-2008, 03:28 PM
I ran the make and it now tries to launch the application. It fails with a module failure on win32com.client

jplumey
01-16-2008, 03:31 PM
Got it running after installing win32com. When I run this script in src out of the IDE, is it running the same code that's running when I run the executable (exe within windows)?

kovidgoyal
01-16-2008, 03:44 PM
Yeah there are probably some issues involved with getting it running from the IDE as i think the EXE installs some needed environment variables and so on.

gwynevans
01-16-2008, 07:14 PM
Thanks, sorted - Notes on your wiki in case they're of use again - https://libprs500.kovidgoyal.net/wiki/WindowsDevelopment

kovidgoyal
01-16-2008, 07:32 PM
Cool thanks. That will be useful for lots of people.