#22 Do no eval...


Patch to try to get rid of the evil `eval()` in the main application. I didn't look at the plugins. In the main application they where really unnecessary.

One `eval()` was in `drpython.drObject` for a test if the object has a given attribute. That's what the builtin function `hasattr()` is meant for. Because it is almost easier to use `hasattr()` in the places where `drObject.VariableExists()` was called I replaced the calls there and in the DrScript documentation.

This leaves us with a class with just one deprecated method. So I deprecated the class itself too and replaced its only instanciation in the main program by a dynamicalle created class and instance for the shared attributes of the DrScript scripts.

While replacing the calls to `drObject.VariableExists()` I noticed that the DrScript examples `SetTerminalArgs.py` and `RunInTerminal.py` didn't work. The `-e` option doesn't work this way with ``rxvt``. But it does with ``xterm``. Which is also to be more likely available on a standard Linux installation. I replaced the invoked terminal of the example and cleaned up the code a little bit.


  • Franz Steinhaeusler

    thanks, put into trunk

  • Franz Steinhaeusler

    • status: open --> closed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks