From ed389d8f05e81c99575ca1779bf427283b4e57a3 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 17 Aug 2012 19:04:39 +0200 Subject: use argparse instead of optparse --- libmproxy/proxy.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libmproxy/proxy.py') diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index ae0e4415..09c56569 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -14,7 +14,7 @@ # along with this program. If not, see . import sys, os, string, socket, time import shutil, tempfile, threading -import optparse, SocketServer +import SocketServer from OpenSSL import SSL from netlib import odict, tcp, http, wsgi, certutils, http_status import utils, flow, version, platform, controller @@ -464,18 +464,17 @@ class DummyServer: # Command-line utils def certificate_option_group(parser): - group = optparse.OptionGroup(parser, "SSL") - group.add_option( + group = parser.add_argument_group("SSL") + group.add_argument( "--cert", action="store", - type = "str", dest="cert", default=None, + type = str, dest="cert", default=None, help = "User-created SSL certificate file." ) - group.add_option( + group.add_argument( "--client-certs", action="store", - type = "str", dest = "clientcerts", default=None, + type = str, dest = "clientcerts", default=None, help = "Client certificate directory." ) - parser.add_option_group(group) TRANSPARENT_SSL_PORTS = [443, 8443] -- cgit v1.2.3