add a try/except block testing for openssl support before adding it as an option to the commandline

This commit is contained in:
Damien Churchill 2009-07-08 18:07:12 +00:00
parent e9541ab7c6
commit 9762853d32

View File

@ -54,8 +54,13 @@ class Web(_UI):
group.add_option("-p", "--port", dest="port", type="int",
help="Sets the port to be used for the webserver",
action="store", default=None)
group.add_option("--ssl", dest="ssl", action="store_true",
help="Forces the webserver to use ssl", default=False)
try:
import OpenSSL
except:
pass
else:
group.add_option("--ssl", dest="ssl", action="store_true",
help="Forces the webserver to use ssl", default=False)
self.parser.add_option_group(group)
@property