-
Notifications
You must be signed in to change notification settings - Fork 211
usingeclipsewithpyjamas
This document provides instructions to setup Pyjamas with ECLIPSE and PYDEV on a windows PC. However the principles can be employed to configure ECLIPSE to support Pyjamas code-completion etc on any platform
- Download and install python http://www.python.org/download/
- Install ECLIPSE IDE. It can be downloaded from http://www.eclipse.org/downloads/
- Install Pydev: http://pydev.org/manual_101_install.html
Once you have the ECLIPSE Python development environment setup and ready it’s time to install Pyjamas. Remember Pyjamas does not provide a plugin for ECLIPSE so we have to manually add Pyjamas to our ECLIPSE’s PYTHON PATH.
Caution: Do not try to add Pyjamas to your Systems. PYTHONPATH, as this might cause undesired results. Only add it to ECLIPSE PYTHONPATH. This way you can experiment with Pyjamas command-line tools, which is important if you are just begining to explore Pyjamas. This is also a recommended way of using the PYJS compiler by the Pyjamas team.
- First Download Pyjamas from http://sourceforge.net/projects/pyjamas/
- Untar and unzip the folder and save at a suitable location on your drive. For example: c:\pyjamas, or on Unix /opt/local/pyjamas
- Now in you ECLIPSE IDE Menu click window->preferences
- Navigate to pydev->Interpreter-Python
- Press New Folder and add "c:\pyjamas-folder\library" and press ok, and ok once more
- Restart ECLIPSE and you’re done. Now try any import statement such as "from pyjamas.ui.{press ctrl-space}" and ECLIPSE will give you the access to all of the Pyjamas modules
- Optionally add the "c:\pyjamas-folder\Addons" folder to use modules contributed by developers
Enjoy Python, ECLIPSE and Pyjamas!
To speed your development cycle, (code,build and test) you can configure eclipse External tools to do the build on a single click:
- go to Run/External Tools
- on the left pane select "program" then right-click "new" to create a new tool launcher, then configure as:
External Tools Configuration,
Name: Pyjamas Builder [Main] Location : /path-to-pyjamas/pyjamas-0.7/bin/pyjsbuild Working directory : ${container_loc} Arguments: ${resource_name}
- To build your code, select the your pyjamas source code, then:
On eclipses top menu click Run/Pyjamas Builder, or just click the "Run External Tool" icon on Eclipse's top bar (the play button with a red toolbox)
- The code will be compiled with the output going to an "output" directory inside your project src directory, the compilaton verbose output will go to the console.
- Once your code is compiled you may run the compiled code inside or outside eclipse by navigating to the output directory and clicking on the generated .HTML file.
- Note: in some cases pyjamas needs other files (.CSS,RPC and others) to be served from a web server, in that case you might need to export the output to an external directory.