|Version 10 (modified by dmartinc, 4 years ago) (diff)|
Most people in the Indico team use Eclipse/PyDev?. There's also a small Emacs community.
Eclipse + PyDev?
Installation and setup
- Download Eclipse (JEE is the best option because it comes with Web Tools): http://www.eclipse.org/downloads/
- Install PyDev? http://pydev.org/updates by adding this URL in Eclipse>Help>Install New Software: link 'Available Software Sites' and Add... (pydev extensions are included into pydev since version 1.5). Note: if you are having problems under Ubuntu 9.10, such as some Eclipse buttons seeming unresponsive, or the Pydev packages not appearing after you add the pydev.org/updates site, check: http://mou.me.uk/2009/10/31/fixing-eclipse-in-ubuntu-9-10-karmic-koala/ )
- Check the boxes for pydev and next, next, next,....
- Open PyDev? perspective and Team Synchronize (CVS, Git, etc): Menu Window>Open perspective>Other...
- Go to window>preferences and:
- go to pydev options> Interpreter - Python > New... (interpreter) and locate/choose your python.exe or python (linux).
- change default encoding: go to General>Workspace> Text file encoding (other: utf-8). In this screen you can profit to select "Refresh automatically" which will avoid having to press F5 when adding new files from outside eclipse.
- In General > Workspace > New text file line delimiter, change to 'Other > Unix'.
- Go to General>Editors>Text Editors and check "Insert spaces for tabs" and "Show line numbers".
- Go to XML>XML Files>Editor and choose "Indent using spaces" (size 4)
- Go to Web>HTML Files>Editor and choose "Indent using spaces" (size 4)
- Go to Web>CSS Files>Editor and choose "Indent using spaces" (size 4)
- Go to General>Editors>File associations. Add file type *.tpl and add associated editor "HTML Editor". Add file type *.wohl and add associated editor "XML Editor".
- Go to General>Editors>Spelling and uncheck "Enable spell checking".
- Press ok to close.
- Go to PyDev? perspective. Go to File>New>PyDev? project. Write a project name (e.g. "indicodev"), uncheck use default, select the root code folder of your indico (...../cds-indico/) (if you do not have it yet, check it out from the repository), choose the grammar version matching with your python version, uncheck "Create default src folder...." and click Finish.
- The whole project will be imported into Eclipse (Team Synch icons might take a while to show up).
- Go to project properties: PyDev? - PYTHONPATH and add the project source folders (code and tools) in order to be able to use F3 (jump to definition).
- add to .cvsignore all the files that you do not want to commit to CVS.
How to debug with Pydev
- F3: go to definition
- ctrl+space: auto-suggest and auto-import if you have pydev extensions.
- ctrl+shift+R: open resource (quick search of resources)
- ctrl+H: search
- F5: udpate
- ctrl+F6: swicht between tabs
- Select name + F4: Hierarchy view.
And others: http://pydev.org/manual_adv_keybindings.html
- The CDS guys have some nice documentation on this;
- There's a nice Emacs mode from Trac wiki editing;
Git is the version control system that is currently used by Indico. On a UNIX system, getting Git working should be fairly easy. If you're working on Windows, you can still run it (though with 50% awesomeness). See GitAndWindows.
- Go to Help > Software Updates > Available Software > Add site.
- Add http://www.jgit.org/updates
- Now in the tree you should see: http://www.jgit.org/updates
- Check JUST the option: Eclipse Git Plugin - Release Build.
- Click Install...and next and accept (license).
- Restart Eclipse.
- Clone your git repo (much easier from command line):
- from Git bash, go to your working folder and do: git clone http://cdsware.cern.ch/repo/cds-indico.git
- from Eclipse, go to File > New > Pydev Project. Write a project name (e.g. "indico.git"), uncheck use default, select the root code folder of your indico (...../cds-indico), choose the grammar version matching with your python version, uncheck "Create default src folder...." and click Finish.
- From Pydev Package Explorer view. Right-click on your new project and then Team > Share Project...> Git > your indico.git project > select