Hi Dirk,

There's currently no support in PyDev for doing what you want.

I think you could make that work by creating a custom plugin that loaded your code (it'd need some java code for the plugin thought). See: http://wiki.eclipse.org/FAQ_Can_I_activate_my_plug-in_when_the_workbench_starts%3F

Then you can probably use org.python.pydev.jython.JythonPlugin.exec(HashMap<String, Object>, String, IPythonInterpreter) to run your Jython code -- although I'm not sure PyDev is the best option in this situation... It really targets more the Python editor and I'm considering making the java packages available more restricted in PyDev to make the startup faster (which could break your code as I see you import many different packages... so, an option could be bundling Jython to your own plugin that has an early startup -- and then you wouldn't be limited by the current Jython 2.1 in PyDev either).



On Fri, May 17, 2013 at 12:16 PM, <Dirk.Volkmar@deutsche-boerse.com> wrote:


I've been experimenting with some python/jython scripting the eclipse. I tried first the examples with the pyedit files.
My aim was to make mass changes a little easier in eclipse.
With a lot of trial and error I succeeded in implementing some features like mass rename of java classes with the refactoring framework and mass replaces in text files. I attached the python file, but it is uncommented.

For loading the actions the actions I take another approach than described in http://pydev.org/manual_articles_scripting.html :

I changed the startup console settings in the Preferences -> PyDev -> Interactive Console to

import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
import test1

Then I started a PyDev Console "Jython using VM running Eclipse Console" and the script should be executed and you should have a menu "Python Scripts" with some entries with key bindings.
In this console I now could do some addtional experiments or just reloading the test1.py after changes.
To use the actions just select classes in the navigator view and press the key combination. Then you can enter a search replace pattern, eg Beer/Water makes all your "alcohohl classes" free of the stuff ;-)

As far as I understand the article mentioned above the scripts with the pyedit prefix are only loaded when the pydev editor starts up.
Is there a possibilty to load a python script at eclipse startup?
Because now I want to rollout the script to my colleagues and they don't have anything to do with jython just programming java.

Best Regards,

Deutsche Börse AG
Chairman of the Supervisory Board/
Vorsitzender des Aufsichtsrats:
Dr. Joachim Faber
Executive Board/Vorstand:
Dr. Reto Francioni (Chief Executive Officer/Vorsitzender),
Andreas Preuss (Deputy Chief Executive Officer/
stellv. Vorsitzender), Gregor Pottmeyer,
Hauke Stars, Jeffrey Tessler.
Aktiengesellschaft with registered seat in/mit Sitz in
Frankfurt am Main.
Commercial register/Handelsregister: HRB 32232
Local court/Amtsgericht Frankfurt am Main.

Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte
sofort den Absender und loeschen Sie diese E-Mail. Das unbefugte Kopieren
dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen
ist nicht gestattet.

The information contained in this message is confidential or protected by
law. If you are not the intended recipient, please contact the sender and
delete this message. Any unauthorised copying of this message or
unauthorised distribution of the information contained herein is prohibited.

Legally required information for business correspondence/
Gesetzliche Pflichtangaben fuer Geschaeftskorrespondenz:

AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
pydev-code mailing list