![]() |
#1 |
Calibre Plugins Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,724
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
How to set up Aptana for Calibre?
So I've got totally fed up with Eclipse deciding to only kick code analysis into life on some of my plugin code files. Instead I am attempting to revisit using Aptana (based on the recommendation of user_none).
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 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,353
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Calibre Plugins Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,724
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
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,487
Karma: 1063785
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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
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: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
|
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,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
|
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
|
Where would I find the equivalent file on Windows?
|
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,227
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
pylib.zip
|
![]() |
![]() |
![]() |
#11 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
|
Are there any others? Aptana Studio is still giving me errors on the lines related to Qt.
|
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,227
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The PyQt modules are in DLLs
|
![]() |
![]() |
![]() |
#13 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
|
It's still not working. I've attached a screenshot of the paths in my preferences. What's missing?
|
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,227
Karma: 27110894
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.
|
![]() |
![]() |
![]() |
#15 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 201
Karma: 1071756
Join Date: Sep 2012
Location: Nova Scotia
Device: Kobo Aura, Nexus 5x
|
I've added some notes at the end of https://www.mobileread.com/forums/sho....php?p=2903293 about enabling the remote debugger in Eclipse (or Aptana - there's absolutely no difference in the relevant code, which is Aptana's pydev plugin whether you use the Aptana branded version of Eclipse or any other Eclipse), and automating plugin reinstallation for debugging from inside eclipse.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |