DSM

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Tab completion in zopectl debug

    8 answers - 1080 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi,
    I have recently learned how to add tab completion to an interactive
    python session and to pdb, thanks to Tom Lazar and to Jacob at
    ParTecs. More info with links on my first blog entry in three months:
    At the end of that entry I ask a question: Can we add tab completion
    to the zopectl debugger? actually more general: can we load the
    ~/.pythonrc.py file when the zopectl debugger is started? In that
    file, the user can arrange tab completion or anything else he wants to
    have available for interactive python sessions.
    It is very easy to do: just add 'import user;' to the command line in
    the do_debug function of $ For
    details, see that blog entry.
    I don't think there are security risks (but don't take my word for
    it). If someone can put malicious python code in that rc file, than
    that someone could just as easily start a python session and enter the
    malicious code there.
    This would just be for convenience. Would this be enough of a
    convenience to put into the Zope source code?
  • No.1 | | 192 bytes | |

    Tue, 17, 2006 at 11:43:50PM +0000, Maurits van Rees wrote:
    This would just be for convenience. Would this be enough of a
    convenience to put into the Zope source code?
    Yes please!
  • No.2 | | 390 bytes | |

    Am Mittwoch, 18. 2006 01:43 schrieb Maurits van Rees:
    Hi,

    I have recently learned how to add tab completion to an interactive
    python session and to pdb, thanks to Tom Lazar and to Jacob at
    ParTecs. More info with links on my first blog entry in three
    months:

    just a thought: you might also use ipython, which has tab-completion by
    default:

    Cheers, Sascha
  • No.3 | | 980 bytes | |

    Maurits van Rees wrote:
    Hi,

    I have recently learned how to add tab completion to an interactive
    python session and to pdb, thanks to Tom Lazar and to Jacob at
    ParTecs. More info with links on my first blog entry in three months:

    At the end of that entry I ask a question: Can we add tab completion
    to the zopectl debugger? actually more general: can we load the
    ~/.pythonrc.py file when the zopectl debugger is started? In that
    file, the user can arrange tab completion or anything else he wants to
    have available for interactive python sessions.

    It is very easy to do: just add 'import user;' to the command line in
    the do_debug function of $ For
    details, see that blog entry.

    Looks good, is there any way this can be done by putting more code in
    do_debug and not usering .pythonrc.py?

    In any case, this would be cool, please add a feature request + patch in
    the collector:

    cheers,

    Chris
  • No.4 | | 469 bytes | |

    Maurits van Rees wrote at 2006-10-17 23:43 +0000:

    >More info with links on my first blog entry in three months:
    >
    >
    >
    >At the end of that entry I ask a question: Can we add tab completion
    >to the zopectl debugger? actually more general: can we load the
    >~/.pythonrc.py file when the zopectl debugger is started?


    Nothing prevents you to call "execfile" at the start of your
    debug session.
  • No.5 | | 198 bytes | |

    Dieter Maurer, on 2006-10-18:
    Nothing prevents you to call "execfile" at the start of your
    debug session.
    Lazyness prevents me to call "execfile" at the start of my debug
    session. :)
  • No.6 | | 719 bytes | |

    Chris Withers, on 2006-10-18:
    Looks good, is there any way this can be done by putting more code in
    do_debug and not usering .pythonrc.py?

    Sure. Instead of adding 'import user' in do_debug, you can add

    print "Hello Chris, good luck with your debugging session!";

    or anything else you fancy. Adding multiline statements probably
    doesn't work that well. So 'import user' seems cleaner to me.

    In any case, this would be cool, please add a feature request + patch in
    the collector:

    I'll experiment some more and listen to other reactions, but then I'll
    look into adding some lines to the collector, yes, unless someone
    beats me to it.
  • No.7 | | 298 bytes | |

    Sascha , on 2006-10-18:
    --
    just a thought: you might also use ipython, which has tab-completion by
    default:
    I saw that mentioned in one of the links on my page as well; looks
    promising; I'll try it out, thanks.
    The following also mention ipython in the light of zope:
  • No.8 | | 1923 bytes | |

    PGP SIGNED MESSAGE
    Hash: SHA1

    Maurits van Rees wrote:
    Hi,

    I have recently learned how to add tab completion to an interactive
    python session and to pdb, thanks to Tom Lazar and to Jacob at
    ParTecs. More info with links on my first blog entry in three months:

    At the end of that entry I ask a question: Can we add tab completion
    to the zopectl debugger? actually more general: can we load the
    ~/.pythonrc.py file when the zopectl debugger is started? In that
    file, the user can arrange tab completion or anything else he wants to
    have available for interactive python sessions.

    It is very easy to do: just add 'import user;' to the command line in
    the do_debug function of $ For
    details, see that blog entry.

    I don't think there are security risks (but don't take my word for
    it). If someone can put malicious python code in that rc file, than
    that someone could just as easily start a python session and enter the
    malicious code there.

    This would just be for convenience. Would this be enough of a
    convenience to put into the Zope source code?

    +1. The original version of zopectl actually supported this, along with
    persistent command-line history: the person who rewrote it didn't
    actually use it, and so left a number of those features out ('test',
    'run', and 'debug' have all been added back in).

    Tres.
    - --
    Tres Seaver +1 202-558-7113 tseaver (AT) palladion (DOT) com
    Palladion Software "Excellence by Design" http://palladion.com
    PGP SIGNATURE
    Version: GnuPG v1.4.2.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    yLElkaygeEay8mf8NDi2Wxw=
    =U2N1
    PGP SIGNATURE

    Zope maillist - Zope (AT) zope (DOT) org

    ** No cross posts or HTML encoding! **
    (Related lists -

    )

Re: Tab completion in zopectl debug


max 4000 letters.
Your nickname that display:
In order to stop the spam: 6 + 5 =
QUESTION ON "DSM"

EMSDN.COM