Menu

#22 Do no eval...

closed
nobody
None
5
2010-08-28
2010-08-09
No

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.

Discussion

  • Marc 'BlackJack' Rintsch

     
  • Franz Steinhaeusler

    thanks, put into trunk

     
  • Franz Steinhaeusler

    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.