|
|
#1 |
|
calibre/Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,087
Karma: 1211084
Join Date: Oct 2010
Location: London, UK
Device: Kindle 3 3G, iPad 2, iPad 3
|
How to set up Aptana for Calibre?
However I am completely and utterly lost to get this up and running. I have tried various combinations of "new folders" and "external libraries" and nothing I have tried gives me a combination that allows me to browse the source code with code analysis working. Clearly this must be down to my ignorance. Would anyone please be so kind as to give a step by step breakdown as to how to get an Aptana workspace up and running for working with Calibre? You can assume I have done the following:
So... what should I do next?
|
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,853
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
Have a beer?
My guess is that the plugins must be in the src folder. That is certainly true for Eclipse/pydev. When playing with your plugin sources, to make eclipse 'see' them I put them in an ignored folder src/plugins. It wouldn't surprise me if aptana does something similar, as they are the same people who built pydev.
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
calibre/Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,087
Karma: 1211084
Join Date: Oct 2010
Location: London, UK
Device: Kindle 3 3G, iPad 2, iPad 3
|
Haha, well it is Easter after all.
Funnily enough in my Eclipse setup I have done exactly what you suggested and put all my plugins within that source control exempted "plugins" folder. And that got me (usually) the behaviour I wanted. Well until it stopped working on a bunch of files for no obvious reason I can see. It was actually user_none who suggested that it should be possible to have the plugins in a separate folder and do something with external libraries, so I set it up that way in anticipation. In the meantime I still have my "Eclipse" copy of the tree/setup to use - but as John reckoned the pydev stuff came from the aptana guys that he had less issues with that setup so I figured it was worth trying... |
|
|
|
|
|
#4 |
|
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,384
Karma: 848775
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
You have calibre checked out and on disk. You have Aptana installed and the Python interpreter setup. As well as your excludes. Perfect.
Now you want to create a new PyDev Project for calibre. File -> New -> PyDevProject. Put in the project name (calibre). Uncheck "Use Default." Change the directory to the calibre root dir (D:\CalibreDev\work\calibre). Click "Finished". You now have a calibre project in Aptana. Let it work for a bit to parse the project and setup things like auto-complete. Now we need to get you're plugins setup. I recommend a separate project for each plugin. Again, create a new PyDev Project. Set the project name to the name of the plugin. Change the directory to the root directory for the plugin. E.G. D:\CalibreDev\plugins\APNXWriterPlugin. If you don't have the source for the plugin in a src sub folder uncheck "Create default 'src' folder...". Click Finish. Right click on the plugin project. Select, Properties. Select "PyDev - PYTHONPATH" on the left. Set the src folder for the plugin. E.G. /APNXWriterPlugin/src. Now change to the "External Libraries" Tab. Select "Add source folder" and select caibre's source folder (D:\CalibreDev\work\calibre\src). Click Apply then Okay. If you have an issue at some point where the auto complete isn't working go back into "External Libraries" and click "Force restore internal info". That's my setup. |
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
I'm trying this again - tried a while back and didn't really get things working.
If I follow those steps, are a ton of errors expected once the project is parsed? e.g.: Spoiler:
over 1700 errors. Notable items that are errors when browsing the code are that a number of popular python libraries like mechanize and lxml sub-modules aren't able to be linked. I've tried calling different variants of the interpreter without any luck. |
|
|
|
|
|
#6 | |
|
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,384
Karma: 848775
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Quote:
1) Install each of those modules as part of your Python installation (what ever interpreter you used for the project). Meaning if you have a Python 2.7 interpreter installed, install the modules for it. Attached is a screen shot of what I mean by installed interpreter. I do other Python development so I have all of the modules installed at the system level. 2) Point the IDE to the bundled libraries within the calibre archive. They're in /Applications/calibre.app/Contents/Resources/Python. Since they're in an app bundle you will need to specify the path manually and not using the file chooser. |
|
|
|
|
|
|
#7 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 91
Karma: 69734
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX, Kindle Fire 1G
|
I set up Aptana Studio 3 just like kiwidude and user_none described but I get errors in the editor when I open files. For example, opening gui2/device.py give this:
Code:
Description Resource Path Location Type Unresolved import: pyqtSignal device.py /calibre/src/calibre/gui2 line 9 PyDev Problem Unresolved import: QAction device.py /calibre/src/calibre/gui2 line 8 PyDev Problem Unresolved import: QActionGroup device.py /calibre/src/calibre/gui2 line 8 PyDev Problem Unresolved import: QDialog device.py /calibre/src/calibre/gui2 line 9 PyDev Problem Unresolved import: QIcon device.py /calibre/src/calibre/gui2 line 8 PyDev Problem Unresolved import: QMenu device.py /calibre/src/calibre/gui2 line 8 PyDev Problem Unresolved import: QObject device.py /calibre/src/calibre/gui2 line 9 PyDev Problem Unresolved import: Qt device.py /calibre/src/calibre/gui2 line 9 PyDev Problem Unresolved import: SIGNAL device.py /calibre/src/calibre/gui2 line 8 PyDev Problem Code:
from PyQt4.Qt import (QMenu, QAction, QActionGroup, QIcon, SIGNAL,
Qt, pyqtSignal, QDialog, QObject)
|
|
|
|
|
|
#8 |
|
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,384
Karma: 848775
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
|
|
|
|
|
#9 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 91
Karma: 69734
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX, Kindle Fire 1G
|
Where would I find the equivalent file on Windows?
|
|
|
|
|
|
#10 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,503
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
pylib.zip
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#11 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 91
Karma: 69734
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX, Kindle Fire 1G
|
Are there any others? Aptana Studio is still giving me errors on the lines related to Qt.
|
|
|
|
|
|
#12 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,503
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The PyQt modules are in DLLs
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#13 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 91
Karma: 69734
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX, Kindle Fire 1G
|
It's still not working. I've attached a screenshot of the paths in my preferences. What's missing?
|
|
|
|
|
|
#14 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,503
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
aptana probably cant read python modules from zip files. unzip pylib.zip and point it to the unzipped directory.
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Set Calibre e-book viewer as default | Huisie | Library Management | 12 | 03-11-2011 08:53 PM |
| ZXreader series field - how do I set it using Calibre? | Boreads | Calibre | 3 | 12-08-2010 11:38 PM |
| set calibre to move books | gheatza | Calibre | 0 | 10-19-2010 01:10 PM |
| Set up Collections with Calibre | goldberry | Sony Reader | 3 | 09-14-2010 11:32 AM |
| is it possible to set mobipocket "subject" metadata from calibre? | rheostaticsfan | Calibre | 3 | 05-20-2010 08:44 AM |