2078
Comment:
|
3488
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
Netbeans is a GUI development evirnoment. The following instructions help to work on Sage. | Netbeans is a GUI development environment. The following instructions explain how to work on Sage, for Linux (Ubuntu 8.10, but should work everywhere). |
Line 7: | Line 7: |
* syntax highlighting and assistance, code completion | |
Line 8: | Line 9: |
* press "CTRL" and click on the class or method name, and you it will jump to it's definition, perhaps opening the apropriate python file.. | |
Line 9: | Line 11: |
* tasks: netbeans searches the source code for tokens that indicate open tasks ("TODO", etc.), in menu: Window > Tasks | |
Line 14: | Line 16: |
* Menu: Tools > Plugins, search for "Python", install | * Netbeans menu: Tools > Plugins, search for "Python", install == Setup == === Definitions === * SAGE_ROOT = root dir of Sage * NETBEANS_ROOT = root dir of netbeans === Instructions === 1. cd $SAGE_ROOT 1. ./sage -sh * note, that $HOME still points to your home dir 1. $NETBEANS_ROOT/bin/netbeans 1. File > New Project - Python > with existing sources * Name: "!SageNetbeans" or what you like, save it in your $HOME dir * Python platform: Manage - "New..." - select Python executable "$SAGE_ROOT/bin/python", name it "Python 2.5.2 Sage" * select "Python 2.5.2 Sage" on the left, on the right in tab "Python Path" you can see the paths are in $SAGE_ROOT/local/lib/... (maybe click "auto detect" ?) 1. next > source root folder: "$SAGE_ROOT/devel/sage/sage" - finish! |
Line 22: | Line 41: |
== Setup == === Definitions === * SAGE_ROOT = root dir of Sage === Instructions === TODO |
|
Line 30: | Line 42: |
Netbeans supports Merucrial out of the box. Right-click on files in "File" window (Window>Files), see local diffs in a special diff window, commit changes, undo local changes. The Netbeans editor itself also supports nonlinear undos, right click on the left side of a highlighed change, see the diff, change only this part as in the local repository. | Netbeans supports Merucrial out of the box. Right-click on files in "File" window (Window>Files), see local diffs in a special diff window, commit changes, undo local changes. The Netbeans editor itself also supports nonlinear undos, right click on the left side of a highlighted change, see the diff, change only this part as in the local repository. |
Line 36: | Line 48: |
* [[http://code.google.com/p/cubeon/wiki/GSTracRepository | cube example for repository integration in netbeans]] * [[http://trac-hacks.org/wiki/XmlRpcPlugin | trac xmlrpc]] |
* [[http://code.google.com/p/cubeon/wiki/GSTracRepository | cube example for Trac repository integration in netbeans]] * [[http://trac-hacks.org/wiki/XmlRpcPlugin | trac xmlrpc]] remote xml procedures to interact with Trac. == Open Issues == * for some reason i don't know all files are marked as "ignored" by mercurial. * you have to build and start Sage still by hand ("./sage -br" on the command line), but it would be possible to select a python script to run in the project properties > run... * pyx/pxd are recognized as normal textfiles |
Developing Python/Sage with Netbeans
Netbeans is a GUI development environment. The following instructions explain how to work on Sage, for Linux (Ubuntu 8.10, but should work everywhere).
Benefits
- syntax highlighting and assistance, code completion
- indexes python and all libraries, i.e. you get a list of all available classes, functions and methods, completion of partial identifiers and they also show you the help for each command.
- press "CTRL" and click on the class or method name, and you it will jump to it's definition, perhaps opening the apropriate python file..
- refactoring: i.e. there is limited support (you have to go through all automatic changes in the preview) for renaming variables, classes, etc.
tasks: netbeans searches the source code for tokens that indicate open tasks ("TODO", etc.), in menu: Window > Tasks
Requirements
- Python
Netbeans menu: Tools > Plugins, search for "Python", install
Setup
Definitions
- SAGE_ROOT = root dir of Sage
- NETBEANS_ROOT = root dir of netbeans
Instructions
- cd $SAGE_ROOT
- ./sage -sh
- note, that $HOME still points to your home dir
- $NETBEANS_ROOT/bin/netbeans
File > New Project - Python > with existing sources
Name: "SageNetbeans" or what you like, save it in your $HOME dir
- Python platform: Manage - "New..." - select Python executable "$SAGE_ROOT/bin/python", name it "Python 2.5.2 Sage"
- select "Python 2.5.2 Sage" on the left, on the right in tab "Python Path" you can see the paths are in $SAGE_ROOT/local/lib/... (maybe click "auto detect" ?)
next > source root folder: "$SAGE_ROOT/devel/sage/sage" - finish!
Note
- After first startup it has to scan and index all the Python stuff (progress indicator bottom right). This could take some minutes, so don't wonder why nothing works...
Personally, I'm not happy with the default GTK theme in ubuntu linux, therefore I have to change the look&feel settings: edit NETBEANS_ROOT/etc/netbeans.conf - in the "netbeans_default_options" variable, change add/change parameter "--laf javax.swing.plaf.metal.MetalLookAndFeel" to get the java specific metal look&feel (or what you want).
Mercurial
Netbeans supports Merucrial out of the box. Right-click on files in "File" window (Window>Files), see local diffs in a special diff window, commit changes, undo local changes. The Netbeans editor itself also supports nonlinear undos, right click on the left side of a highlighted change, see the diff, change only this part as in the local repository.
Trac Integration
It is theoretically possible to integrate Netbeans with Trac using Cube°n. Maybe someone wants to look deeper into this ...
in netbeans, Tools > Plugins - Install "cube" (all of them)
trac xmlrpc remote xml procedures to interact with Trac.
Open Issues
- for some reason i don't know all files are marked as "ignored" by mercurial.
you have to build and start Sage still by hand ("./sage -br" on the command line), but it would be possible to select a python script to run in the project properties > run...
- pyx/pxd are recognized as normal textfiles