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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-17-2009, 11:56 AM   #1
JirkaS
Member
JirkaS began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Nov 2009
Location: Prague, Czech Republic, Europe
Device: iPhone, Sony PRS 505
Developer support

Hi all,
I'm developer and I'm trying to setup development environemet on Windows. So far I got Python, Bazar, source code, tried the "hello world" test. So far so good. But for any serious development, one need also debugger. I've tried to read thru help, tried posts here, but so far I found no word about how to debug it.
Another question - is there any design documentation, diagrams - about modules for example?
Thanks a lot for comments.
JirkaS is offline   Reply With Quote
Old 11-17-2009, 12:18 PM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,106
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
I installed the Eclipse IDE which includes a python debugger as an option.
itimpi is offline   Reply With Quote
Old 11-17-2009, 03:10 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There isn't any design documentation, beyond a brief outline of the code structure in the development section of the User Manual, but feel free to ask any questions and I'll try my best to answer.

On a tangential note, I developed calibre without the use of a debugger and still don't use one today. But python comes witha nice debugging module called pdb. You can use it to do interactive debugging via the command line. Just run

calibre-debug

and you will get a python prompt with a fully initialized calibre environment. You can them import the pdb module and do whatever debugging you want.
kovidgoyal is offline   Reply With Quote
Old 11-22-2009, 11:21 AM   #4
JirkaS
Member
JirkaS began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Nov 2009
Location: Prague, Czech Republic, Europe
Device: iPhone, Sony PRS 505
Well, still no luck. if I run calibre-debug, it crashes (crash on the line where is calls ipython()), so no luck.
I also get Eclipse, get Pydef extension, I did some little training on Python and it worked. Next I load calibre sources in Eclipse (created workspace and python project for it), but I still don't know where to start - what is the entry point for running it in debug mode.
You know - I'm novice in Python, all my previous experience was in C, C++ and some C#, so forgive, if these are stupid questions.
JirkaS is offline   Reply With Quote
Old 11-22-2009, 11:52 AM   #5
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,473
Karma: 1053245
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by JirkaS
... I still don't know where to start - what is the entry point for running it in debug mode.
Have a look at src/calibre/linux.py There is a dictionary called entry_points which will lists them.

Quote:
Originally Posted by JirkaS
You know - I'm novice in Python, all my previous experience was in C, C++ and some C#, so forgive, if these are stupid questions.
No question is a stupid question; calibre is a very complex piece of software. Feel free to ask me questions about the design and what not as well.
user_none is offline   Reply With Quote
Old 11-22-2009, 12:15 PM   #6
JirkaS
Member
JirkaS began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Nov 2009
Location: Prague, Czech Republic, Europe
Device: iPhone, Sony PRS 505
Hey, thanks, this is really helpfull. Now one more question - I'm trying to test some changes, but I have my library on the same computer. How to separate development environment and production environment? Is changing the library path enough, or do i need to make more adjustments?
Thanks Jirka
JirkaS is offline   Reply With Quote
Old 11-22-2009, 12:22 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Generally speaking changing the library path should be enough, as long as the changes you make don't affect the configuration settings, as they are common too.
kovidgoyal is offline   Reply With Quote
Old 11-22-2009, 12:30 PM   #8
JirkaS
Member
JirkaS began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Nov 2009
Location: Prague, Czech Republic, Europe
Device: iPhone, Sony PRS 505
Is there a way to have 2 different sets of configurations other than zipping them and replacing the one one I don't want to use?
JirkaS is offline   Reply With Quote
Old 11-22-2009, 12:36 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Environment variable CALIBRE_CONFIG_DIRECTORY
kovidgoyal is offline   Reply With Quote
Old 11-22-2009, 02:09 PM   #10
JirkaS
Member
JirkaS began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Nov 2009
Location: Prague, Czech Republic, Europe
Device: iPhone, Sony PRS 505
Still problems: now running debugger on debug.py will produce following error:
ImportError: No module named PyQt4.QtCore.
I tried to look it up and yes, there is no such module. Any idea what I need to do?
I see same issue for PyQt4.QtGui and for mechanize.
JirkaS is offline   Reply With Quote
Old 11-22-2009, 02:37 PM   #11
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,473
Karma: 1053245
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by JirkaS View Post
Still problems: now running debugger on debug.py will produce following error:
ImportError: No module named PyQt4.QtCore.
I tried to look it up and yes, there is no such module. Any idea what I need to do?
I see same issue for PyQt4.QtGui and for mechanize.
Install PyQt4 and mechanize. You will also need to install Qt and all of the other dependencies. Off the top of my head: python-sqlite, lxml, Python Imaging Library, ImageMagick, BeautifulSoup, poppler >= 0.12 and podofo. Oh and since you are on Windows you will need a working install of Microsoft's C++ compiler.
user_none is offline   Reply With Quote
Old 11-22-2009, 02:53 PM   #12
JirkaS
Member
JirkaS began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Nov 2009
Location: Prague, Czech Republic, Europe
Device: iPhone, Sony PRS 505
Do I really need C++? I though this is Python project. This is starting to be a bit too complicated for me....
JirkaS is offline   Reply With Quote
Old 11-22-2009, 03:11 PM   #13
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,473
Karma: 1053245
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by JirkaS View Post
Do I really need C++? I though this is Python project. This is starting to be a bit too complicated for me....
The vast majority of the application is written in Python. However, a few parts are written in C/C++ for performance reasons.
user_none is offline   Reply With Quote
Old 11-22-2009, 04:28 PM   #14
JirkaS
Member
JirkaS began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Nov 2009
Location: Prague, Czech Republic, Europe
Device: iPhone, Sony PRS 505
OK, I'm a bit further. Now the problem is in load_plugins() "constants.py". It ends on the line:
plugin_path = sys.extensions_location
AttributeError: 'module' object has no attribute 'extensions_location'

Last edited by JirkaS; 11-22-2009 at 04:49 PM.
JirkaS is offline   Reply With Quote
Old 11-22-2009, 11:12 PM   #15
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you are using the method oulined in the user manual then you cant execute calibre scripts with a normal python interpreter, you have to use

calibre-debug -e
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hello from potential developer whippy Introduce Yourself 4 06-05-2009 11:20 AM
New Developer Here infosprt Introduce Yourself 0 08-28-2008 08:10 PM
iLiad Units that download the developer package lose warranty and free of charge support !? Ovydake iRex Developer's Corner 13 08-02-2008 11:24 AM
Developer Kit Patrick B. Ludwi iRex 1 06-17-2008 02:46 PM
PRS-500 Developer needs help getting started cmumford Sony Reader Dev Corner 12 12-22-2006 03:28 AM


All times are GMT -4. The time now is 02:53 PM.


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