xRope: A lightweight IDE for Python
(written in Python):
Introduction:
Concise description:
xRope is an IDE (VB-like or Delphi-like) for Python.
It uses an emacs-like editor ("rope").
It has a build-in Graphical Builder, a Project Manager, a file
manager and an integrated code checker.
XRope is lightweight and fast.
Goal:
Provide a decent Builder for Python developers, using reliable,
portable components.
New in version 1.4.4:
Multi-platform version: Works Under Liunx,
Windows XP and Windows Vista.
Installation procerure under Windows:
Python 2.5 (www.pyhton.org) is a prerequisit, it is assumed to
be installed at: C:\python25\ , otherwise the environment script
might have to be edited accordingly.
Unzip the source on c:\ , it creates the folder c:\xrope-1.4.4
Check that the scripts set_env.bat and
set_env.py contain the correct location of
Python 2.5 on your system. The default is C:\python25. If Python
is installed at another location on your system, please change
modify set_env.bat and set_env.py accordingly.
run the batch file set_env.bat
run the installation command: python setup.py
install (as system manager) .
To run the application xRope: C:\python25\python.exe xrope.py
Preferred directory to store your python source code:
c:\workspace
or c:\users\yourname\workspace (for instance)
But NOT c:\"My Documents"\workspace
(xRope doesn's cope yet with spaces in
paths)
Installatin Under Linux:
"python setup.py install" (Debian, as root) or "sudo python setup intall" (Ubuntu)
to run: python /usr/bin/xrope
NB: python 2.5 is a prerequisit
New in version 1.4.3:
New functions: "indent block" "deindent
block" in Edit menu.
"Print current module (via firefox)": Sends an HTML-formatted,
highlighted, version of the currennt module to mozilla firefox for
printing.
Add block delimiters to current module: Adds
Ruby-style block delimiters to the blocks of the current
module (in the form of comments).
Highlighing for Karrigell
applications server development (.ks, .pih, .hip, .htm, .html,
.xml files).
Code generator: "XML to Tkinter": Builds a Python
Tkinter graphical interface from an XML template (with XML validation) .
See example of a typical XML example here)
New in version 1.4.0:
Depends on rope-0.7.7 and ropeide-1.5.0 (which are installed only if no
other version of rope or ropeide are installed yet)
If older versions of rope / ropeide are installed, their manual
deinstallation might be necessary (they are situated in
/usr/lib/python2.5/site-packages/)
The dependency upon rope / ropeide is done through inheritance, it has
the following advantages:
xRope does not interfere with (or modify) rope or ropeide, so
ropeide and xRope can be run independently.
xRope benefits from the improvements of rope-0.7.7 regarding
refactoring.
xRope can be upgraded to the latest version of the rope refactoring
library by merely installing the latest version of rope available
from Sourceforge.
Shipped with the latest version of Pmw : Pmw.1.3.2 (installed only
if no older version of Pmw is present).
Warning:
Since the latest version of the refactoring library rope is being used,
the automatically generated configuration files ".ropeproject" might not
be compatible with the current rope / xRope project formats.
The solution consists in simply manually deleting the ".ropeprojects"
files from the root of the projects.
Classes auto-complete (dot-complete : Displays the methods
belonging to a class or instance thereof)
Example:
a = 'hello'
a.
Then hit: "Alt-/" to get the
corresponding methods of the string class.
Once the method is selected it insets itself after the dot.
The docstring (and hence, the arguments of the method) are displayed
by hitting: "Ctrl-C Ctrl-D" .
build-in "help" functions: (one which is build-in and one
which launches an external web browser)
build-in "run" (launched in a separate thread)
build-in "check" (launched in a separate thread)
build-in "Visual Builder", tightly integrated with "run",
"check" and "edit" (all of whom can be run concurrently thanks to a
multithreaded design)
build-in grep scanning only directories in the current
project
features inherited from rope:
Refactoring
Emacs keys bindings (also provided by rope)
Components:
It uses Python with Tkinter,
Pmw (Python mega widgets)
The "Tree widget" (by G. E. Cash, see:
http://www.magicnet.net/~gcash).
The Graphical builder is the "tk_happy" python application from
sourceforge.
The code checker is: "pychecker.
Manual:
Installing the application
Decompress the tar.gz file in your home directory.
Go to xrope-1.xxx
Go to src
Type: python setup.py install (as root) or sudo python setup
install (for Ubuntu or Mac OS X).
Open a project (and select a module for editing or "run" or
"check")
Use the file manager located at the left-hand side of the IDE and
navigate to the desired location (from one of the three preset
locations "Home", "Root", or "Workspace" (i.e.
"/home/your_home_dir/workspace")
Right-click on the chosen directory: and click on the pop-up
item entitled: "Mark folder as current project "
From there you can open and edit any file contained in the project
directory or a sub directory thereof, by double-clicking on the icon
of an existing module (module selection). If no module exists yet,
you may create a new file or module from the menu: with
File
New File or new module (the .py extension mustn't be given as a
part of the module name: it is added automatically).
A double-click on an already selected module also refreshes the
class browser display
Browser:
The "browser" tab at the right-hand side of the IDE allows you to
visualize the classes, methods and functions of the current module
(the one which has last been activated by a double-click on it's icon
in the file manager). A double-click on a method moves the editor and
the cursor at the location in the module where the method is defined.
Grep:
The "Grep" tab at the right-hand side of the IDE allows you to
search for a word (or a regular expression).
Select the Grep tab
Enter the search term or regular expression in the yellow entry
field
type enter or click on the "Grep button under the entry
field"s
Help:
The Help tab at the right-hand side of the IDE allows you to get
help about a python object (module or class)
Select the help tab
Enter the name of the object in the yellow entry field
type enter or click on the "Pydoc text button under the entry
field"
Alternatively, clicking on the : "Pydoc (browser)" button will
start a local (python) server on your workstation and launch on the
available HTTP browsers to display help about the python libraries
available on your system in HTML format
Settings:
The "settings" tab at the right-hand side of the IDE allows you to
modify the fonts used by the editor (for the duration of a session.
All files opened after the fonts settings have been changed will
display the code using your new settings.
To make this change permanent you can edit the (hidden) "~/.rope"
file from the menu ("edit", the "edit ~/.rope").
Run:
The "Run" tab at the right-hand side of the IDE allows you to run
the currently selected module (selected by a double-click in the
build-in file manager, see above: "open a project"). You can also
refresh the output display or interrupt the execution of the running
module.
Check:
The "Check" tab at the right-hand side of the IDE allows you to run
the currently selected module (selected by a double-click in the
build-in file manager, see above: "open a project"). You can also
refresh the output display or interrupt the check of the running
module.
Graphical Builder:
The "Graphical Builder" tab at the right-hand side of the IDE
allows you to launch a graphical builder application in the currently
opened project (selected by a double-click in the build-in file
manager, see above: "open a project"). You can:
Draw a graphical (Tkinter) interface.
Save the result in the current directory. (The result is saved
both as a definition (.def) file and as a python source code.
Launch its execution (once saved and selected from the file
manager)
Edit the generated module (in the parts of where it is advised
to do so)
Add behavior to the graphical components.
Save it , exit it and get back to it later by reopening
respectively:
The module in xRope
The .def file via the Graphical Builder
Code generator: XML template to Tkinter code converter :
The "Utils" tab at the right-hand side of the xRope GUI contains a
Button entitled: "XML to Python Tkinter code".
This functon allows to create a Tkinter interface Python code from
an XML template.
Here is an example of XML template used to generate the code of a a
Tkinter interface using the "xml to Python Tkinter code" function
under "Utils"