By Ingeniweb. A Django site.
Septembre 23, 2007
Cyrille Lebeaupin
cyrille
Clebeaupin's Weblog is about »
» How to python on eclipse IDE ?


This how-to has been tested on ubuntu but you can adapt it easily to other OS.

Eclipse is well known in the Java world and well known because this is an heavy editor that consume a lot your computer resources. This IDE is very powerful and provides a lot of plugins that can make you more productive. In this article, we’ll see how to install Eclipse to have a great python development environment.

Before installing Eclipse, make sure you have already installed a Java Runtine Environment 6 (package sun-java6-jre). Prefer JRE 6 to the JRE 5, because Sun has made some improvements to make Java faster.

Go to http://download.eclipse.org/eclipse/downloads/. Click on 3.3 in Latest Release section, then in Platform Runtime Binary section download your appropriate eclipse version. In my case, I have selected the eclipse-platform-3.3-linux-gtk.tar.gz release.

Extract eclipse from the archive you have just downloaded:

clebeaupin@atalante:~/tmp$ tar zxvf eclipse-platform-3.3-linux-gtk.tar.gz

Install eclipse in /opt to make it available for all users on your computer:

clebeaupin@atalante:~/tmp$ sudo mv eclipse /opt/

Before launching eclipse with root user make sure all files in /opt/eclipse are owned by root user:

clebeaupin@atalante:~/tmp$ sudo chown -R root:root /opt/eclipse

You are ready to launch eclipse. You have to launch it in root mode to install the needed plugins. If you do it with your specific user, plugins will not be available for all you computer users.

So do it:

clebeaupin@atalante:~/tmp$ sudo /opt/eclipse/eclipse

A popup like the following one appears. Keep the workspace location and check box Use this as default and do not ask again and click on OK button.

Workspace Launcher

After few seconds Eclipse is launched and is configured with the basic plugins. Those we need are the following ones:

  • WTP (Web tools platform) to edit CSS, JS, HTML and XML files
  • CVS to work with CVS repositories
  • Subclipse to work with SVN repositories
  • Pydev to edit python files
  • AnyEditTools to add very useful features in text edition

Plugin Installer

To install them and for each plugin you’ll have to go in Help > Software updates > Find And Install… menu and select Search for new features to install. Each plugin will be added from this screen:

Install Plugins

WTP (Web tools platform) plugin installation

  1. Check box Europa Discovery Site
  2. Click on Finish button and then select your mirror
  3. On Updates popup, deploy Europa Discovery Site > Web and JEE Development
  4. Check Web Standard Tools, click on Select Required button to select all dependencies and click on the Next button
  5. Accept the terms in the licence agreements and click on Next button
  6. Click on Finish button and eclipse will download all the necessary files
  7. Then install all the downloaded files by clicking on Install All button

CVS plugin installation

  1. Check box Europa Discovery Site
  2. Click on Finish button and then select your mirror
  3. On Updates popup, deploy Europa Discovery Site > Collaboration Tools
  4. Check Eclipse CVS Client and click on the Next button
  5. Accept the terms in the licence agreements and click on Next button
  6. Click on Finish button and eclipse will download all the necessary files
  7. Then install all the downloaded files by clicking on Install All button

Subclipse plugin installation

  1. Click on New Remote Site… button, enter this title: Suclipse and this url: http://subclipse.tigris.org/update_1.2.x
  2. Check box Subclipse and click on Finish button
  3. On Updates popup, deploy Subclipse > Subclipse Plugin
  4. Check Subclipse and click on the Next button
  5. Accept the terms in the licence agreements and click on Next button
  6. Click on Finish button and eclipse will download all the necessary files
  7. Then install all the downloaded files by clicking on Install All button

Pydev plugin installation

  1. Click on New Remote Site… button, enter this title: Pydev and this url: http://pydev.sourceforge.net/updates/
  2. Check box Pydev and click on Finish button
  3. On Updates popup, deploy Pydev > Pydev
  4. Check Pydev and click on the Next button
  5. Accept the terms in the licence agreements and click on Next button
  6. Click on Finish button and eclipse will download all the necessary files
  7. Then install all the downloaded files by clicking on Install All button

AnyEditTools plugin installation

  1. Click on New Remote Site… button, enter this title: Andrei plugins and this url: http://andrei.gmxhome.de/eclipse/
  2. Check box Andrei plugins and click on Finish button
  3. On Updates popup, deploy Andrei plugins > Eclipse 3.2 - 3.3 plugins
  4. Check AnyEditTools and click on the Next button
  5. Accept the terms in the licence agreements and click on Next button
  6. Click on Finish button and eclipse will download all the necessary files
  7. Then install all the downloaded files by clicking on Install All button

The end

If you have succeeded in installing all the above plugins, you can close Eclipse and launch it in a normal way:

clebeaupin@atalante:~/tmp$ /opt/eclipse/eclipse

Septembre 20, 2007
Cyrille Lebeaupin
cyrille
Clebeaupin's Weblog is about »
» How to edit remote files with your favorite editor ?


This how-to only works on Linux OS and has been tested on a recent Ubuntu release.

In many cases, you have a simple SSH access to edit files on a remote server. Because this is a remote server you can only use remote editors like vi and sometimes emacs. These editors are not so bad but if you are not at your ease using them you can quickly become like this nervous guy.

Maybe you prefer to use one of your local editor like bluefish, gedit or kate. So just do it …

Assume that you have an access with user clebeaupin to the remote server named remote.server.com. To connect, you just have to type this following line in a terminal:

clebeaupin@atalante:~$ ssh clebeaupin@remote.server.com

Then if you want to edit a file :

clebeaupin@remote.server.com:~$ vi /etc/httpd/httpd.conf

What’s this fucking editor for geek guys ?
If you want to relax and forget vi in the dark side of your brain, just use fuse kernel module with sshfs plugin. Fuse+sshfs allows you to mount on your local filesystem a remote filesystem. To install it, just open a shell and type the following lines:

clebeaupin@atalante:~$ sudo apt-get install sshfs

Before mounting a remote filesystem, you must add the fuse group to your user like this:

clebeaupin@atalante:~$ sudo adduser clebeaupin fuse

And check that fuse module is loaded at kernel boot:

clebeaupin@atalante:~$ ls -la /dev/fuse
crw-rw—- 1 root fuse 10, 229 2007-09-20 00:46 /dev/fuse

If not just add it to /etc/modules file.

Then to make sure everything goes right, just reboot your system.

After re-booting and re-logging, you can mount a remote filesystem on your local computer. For example, if you want to mount all remote filesystem of remote.server.com in the directory /home/clebeaupin/mnt, type this:

clebeaupin@atalante:~$ sshfs clebeaupin@remote.server.com:/ /home/clebeaupin/mnt

If you want to restrict the mounted filesystem to a specific directory like /etc, do this:

clebeaupin@atalante:~$ sshfs clebeaupin@remote.server.com:/etc /home/clebeaupin/mnt

At this time you can list, view and edit all files of the remote server. You can use all command lines like ls, rm, mkdir and of course gedit in /home/clebeaupin/mnt:

clebeaupin@atalante:~$ gedit /home/clebeaupin/mnt/modules &

It works. And if you have enough permissions you can break all config files of the remote server with your favorite editor :-)

Septembre 18, 2007
Cyrille Lebeaupin
cyrille
Clebeaupin's Weblog is about »
» You are welcome

Hello and welcome to my new blog. I will talk about a famous python CMS : Plone.

5 years ago, I was very interested in working on web development. I have tried many web technologies like PHP, J2EE and one day I heard about Zope.

What was my surprise ?

Try Python and you will not want to work any more on languages like C++ or Java.

Try Zope and you will be fascinated by the easy way to store objects in an object-oriented database (ZODB) instead of a relational database.

After few months on Zope, I have discovered Plone. I began with version 2.0 and always work with Plone at the time. A lot of things in Plone, Zope and Python make web development so easy that you don’t want to stop working with these technologies.

Now it’s time to share some of my experiences on Plone.