[Twisted-Python] Implementing parseargs or getopt using twisted trial

Vishal Sethia sethia.vishal at gmail.com
Wed Jan 17 13:31:50 EST 2007


How do I implement user defined command line options in addition to the
default switches that are available while running twisted trial.  For ex. if
I have my own py file which I execute using the python compiler has the
following line of code to support several command line options, how do I
achieve this using twisted trial

For eg,
    for o,a in opts:
        if o == "-d":
            debug = 1
        if o in ["-h","--help"]:
        if o in ["-c","--configfile"]:
            if debug:
            config_file = a
        if o in ["-f","--factory"]:
        if o in ["-o","--output"]:
            log_file = file(a,"w")

Any pointers would be greatly appreciated.

-- V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070117/206b151d/attachment.htm 

More information about the Twisted-Python mailing list