10-15-2011, 12:13 AM | #16 |
Member
Posts: 15
Karma: 10
Join Date: Oct 2011
Device: iPad,Kindle3
|
Hello kovid, we love Calibre!
I did not install calibre with yum, RPM. $ yum list | grep alibre $ rpm -qa | grep alibre $ sudo find / -name calibre /usr/share/calibre /usr/bin/calibre /home/katsu/calibre /home/katsu/calibre/calibre /home/katsu/calibre/calibre/src/calibre /home/katsu/.config/calibre /opt/calibre /opt/calibre/lib/python2.7/site-packages/calibre /opt/calibre/calibre /opt/calibre/bin/calibre /etc/bash_completion.d/calibre /root/.config/calibre $ $ ls -l /usr/share/calibre total 4 drwxr-xr-x 3 root root 4096 Oct 9 19:36 man $ $ which calibre /usr/bin/calibre $ ls -l /usr/bin/calibre lrwxrwxrwx 1 root root 20 Oct 9 19:36 /usr/bin/calibre -> /opt/calibre/calibre $ ls -l /opt/calibre/calibre -rwxr-xr-x 1 root root 368 Sep 30 19:08 /opt/calibre/calibre $ cat /opt/calibre/calibre #!/bin/sh path=`readlink -f $0` base=`dirname $path` lib=$base/lib export LD_LIBRARY_PATH=$lib:$LD_LIBRARY_PATH export MAGICK_HOME=$base export MAGICK_CONFIGURE_PATH=$lib/ImageMagick-6.6.7/config export MAGICK_CODER_MODULE_PATH=$lib/ImageMagick-6.6.7/modules-Q16/coders export MAGICK_CODER_FILTER_PATH=$lib/ImageMagick-6.6.7/modules-Q16/filters $base/bin/calibre "$@" $ $ calibre --version calibre (calibre 0.8.21) $ |
10-15-2011, 12:26 AM | #17 |
creator of calibre
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
All you should need to do in that case is set CALIBRE_DEVELOP_FROM correctly. Then the source will be used.
Things to check: 1) CALIBRE_DEVELOP_FROM is set correctly to the the src directory, no typos 2) Start calibre as /opt/calibre/calibre-debug -g Stick your print 'Hello, world' in src/calibre/__init__.py |
Advert | |
|
10-15-2011, 03:43 AM | #18 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Make sure that CALIBRE_DEVELOP_FROM is exported as well as set correctly.
|
10-15-2011, 08:27 AM | #19 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
10-15-2011, 09:09 AM | #20 |
Member
Posts: 15
Karma: 10
Join Date: Oct 2011
Device: iPad,Kindle3
|
Bingo!!
it should be EXPORTed! Code:
$ export CALIBRE_DEVELOP_FROM=/home/katsu/calibre/calibre/src $ /opt/calibre/calibre-debug -g Hello, world! Compiling form /home/katsu/calibre/calibre/src/calibre/gui2/shortcuts.ui Compiling form /home/katsu/calibre/calibre/src/calibre/gui2/filename_pattern.ui ... Compiling form /home/katsu/calibre/calibre/src/calibre/gui2/catalog/catalog_csv_xml.ui Starting up... Started up in 3.13954114914 |
Advert | |
|
10-15-2011, 09:26 AM | #21 |
Member
Posts: 15
Karma: 10
Join Date: Oct 2011
Device: iPad,Kindle3
|
I wish if there are "--show-environment-all" and/or "--show-argument-all" option in debug mode...
|
10-20-2011, 06:46 AM | #22 |
Junior Member
Posts: 1
Karma: 10
Join Date: Oct 2011
Device: Nook 1.0
|
Trouble Running from Development Version
Does it suffice to have these 2 .bat files on the desktop and run the dev version directly from the .bat file? Also, when I ran the dev version, the program was able to convert files and put them into the folder that I chose, but upon looking manually into the folder, there was no file? Is this normal?
Upon running the dev version again, the conversion was saved, but once again no file to speak of in the folder. Anyone know what's happening? |
01-19-2012, 07:39 AM | #23 |
Junior Member
Posts: 2
Karma: 10
Join Date: Feb 2011
Device: Pocketbook 903
|
Dear Calibre community, sorry for asking here but I could not find answers so far how to setup the complete Windows development environment for calibre. I just want to know if there is any more or less detailed description how to do it.
What I tried and what I want: I am a developer for embedded software and years ago I used Visual C++ to develop a GUI Control Monitor. Technology evolved and why not to learn Python and Qt now? Calibre is just a great program and I really enjoy using it. I like to learn from example and wish to analyze the calibre source code and its build environment. I followed the instructions in http://manual.calibre-ebook.com/develop.html and succeeded with print ("Hello, world!"). But adding the line from “calibre import ipython” brought: C:\Program Files (x86)\Bazaar\calibre\src>calibredb Hello, world! Python function terminated unexpectedly cannot import name ipython (Error Code: 1) Traceback (most recent call last): File "site.py", line 132, in main File "site.py", line 108, in run_entry_point File "C:\Program Files (x86)\Bazaar\calibre\src\calibre\__init__.py", line 43, in <module> from calibre import ipython ImportError: cannot import name ipython I changed the line to “from calibre.utils import ipython” and succeeded with loading without knowing it is correct now or not. Probably not, because “ipython(locals())” gave me: C:\Program Files (x86)\Bazaar\calibre\src>calibredb Hello, world! Python function terminated unexpectedly 'module' object is not callable (Error Code: 1) Traceback (most recent call last): File "site.py", line 132, in main File "site.py", line 108, in run_entry_point File "C:\Program Files (x86)\Bazaar\calibre\src\calibre\__init__.py", line 41, in <module> ipython(locals()) TypeError: 'module' object is not callable Despite of this I wondered how to build all the *.exe and *.dll Files inside the binary calibre install directory. I found the link http://oldbugs.calibre-ebook.com/wik...owsDevelopment, but it is more than 2 years old, so I do not know if it is the nowadays way to setup the complete Windows development environment for calibre. I would expect some sort of make Environment. May be I just did not found the right link. Any hint would be very helpful. teaage |
01-19-2012, 09:00 AM | #24 |
creator of calibre
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There is no need to build the binary calibre components to work on calibre. Doing so is not a trivial task. When doing an import you should make sure it is not a global level as otherwise it can cause circular imports. Put it inside a function that you want to debug.
|
01-20-2012, 04:20 AM | #25 |
Junior Member
Posts: 2
Karma: 10
Join Date: Feb 2011
Device: Pocketbook 903
|
In-between I found “Notes on setting up the windows development environment” in the file C:\Program Files (x86)\Bazaar\calibre\setup\installer\windows\notes .rst and after reading it I agree that it is not a trivial task.
|
01-20-2012, 05:00 AM | #26 |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
I agree that building Calibre from scratch on a Windows system is not trivial.
However most people simply want to be able to do Calibre development at the python level, and setting up a development environment for that IS trivial and is covered in the User Guide. All you need is the Calibre source and the setting of a single environment variable. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sony Reader Information, Start-Up and Reset Guide | grooks | Sony Reader | 2 | 12-22-2010 07:06 PM |
Prscustomizer not working and info on unicode | shilpa | Sony Reader | 1 | 08-14-2009 01:35 AM |
California to start using Open Source etextbooks | Nate the great | News | 87 | 05-11-2009 12:18 PM |
Different info between reader and Calibre db | eyp | Calibre | 8 | 03-19-2009 03:53 AM |
Sun's McNealy working on open source textbooks | Bob Russell | News | 8 | 12-12-2006 02:03 PM |