-
Notifications
You must be signed in to change notification settings - Fork 0
Using Eclipse with autotest
-
Download latest Eclipse (doesn't matter which version, there is no existing stock version with python) http://download.eclipse.org/eclipse/downloads/
-
Use any folder as default workspace path (it's basically a name, you can have sources anywhere else)
-
Select Help->Install new software and Add new source and install current version of PyDev for Eclipse
Name: pydev Location: http://pydev.org/updates
- Select Help->Install new software and Add new source and install current version of Eclipse EGit
Name: egit Location: http://download.eclipse.org/egit/updates
-
After Eclipse restart right-click in Navigator window and select
Import...
,Git->Projects from Git
, add Autotest base directory and on next window checkImport as general project
. -
From now one, you can start developing Autotest. Anyway I'd recommend you to go through next section first ;-)
- First autotest is importing libraries in different namespace. I've found a way to get over this using symlink.
mkdir -p $somedir/autotest touch $somedir/__init__.py touch $somedir/autotest/__init__.py ln -s $autotest_root/client $somedir/autotest/client
-
than you add this directory to python path in
right-click on project
->properties
->PyDev - PYTHONPATH
->External Libraries
clickAdd source folder
and find the$somedir
directory. -
From now one you'll see docstrings and all the other usual features of Eclipse.
Eclipse can automatically check quality of your code using pep8.py. In newer versions you can find it in Window
->Preferences
->PyDev
->Editor
->Code Analysis
->pep8.py
. By default it's turned off so just change the value to Warning
and you'll see little exclamation mark by the unmatching lines.
I'd recommend you to turn on line numbers (Window
->Preferences
->General
->Editors
->Text Editors
->Show line numbers
There are some basic stuff that made me switch from VIM.
- hoover over anything and you'll get docstring/definition/... of the context
- ctrl+left-click and it'll transfer you to the definition
- when you place cursor somewhere, it highlights other occurrences of the current value/function
- window->new editor opens the current source in another view. You will have 2 cursors, 2 highlights, 2 parts of current file
- window->new window opens new window :-)
- Right-click->refactor... does a lot of nice things (not that powerful as with Java thought, but still a great tool with preview)
- drag and drop layouts (split view, hide consoles ... just click and move everything everywhere)
- DEBUGING (see the next chapter)
I'm not using Eclipse for Autotest execution (although it can do that too) as I prefer xterm outputs...
TODO