From 21dce29ec0a74b563e75f9d70fbeac1d39ca9c89 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Thu, 20 May 2010 08:55:16 +0200 Subject: [PATCH] Corretto typo e aggiunte opzioni per porta e host. --- pywhois.py | 2 +- pywhoisd.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pywhois.py b/pywhois.py index 8d08f59..11f8417 100644 --- a/pywhois.py +++ b/pywhois.py @@ -79,7 +79,7 @@ class WhoisRequestHandler(SocketServer.StreamRequestHandler): def handle(self): # Come prima cosa salutiamo - hello = self.server.config['welcome_message'] + hello = self.server.config['welcome_banner'] if hello: response = FormatMessage(hello) else: diff --git a/pywhoisd.py b/pywhoisd.py index 41672e5..a51add4 100755 --- a/pywhoisd.py +++ b/pywhoisd.py @@ -16,6 +16,10 @@ if __name__ == "__main__": parser.add_option("-c", "--config", dest="config_file", default="pywhoisd.conf", help = "Set config file", metavar="CONFIG_FILE") + parser.add_option("-p", "--port", dest="port", + help = "The listening port of the daemon", default = "43") + parser.add_option("-l", "--listen", help="The listening address of the daemon", + default = "0.0.0.0", dest="host") (options, args) = parser.parse_args() @@ -25,7 +29,7 @@ if __name__ == "__main__": logger = pywhois.Logger(options.verbose) # Prepare the real server, listening to the whole world - host, port = "0.0.0.0", 43 + host, port = options.host, int(options.port) server = pywhois.WhoisServer((host, port), logger, config) try: server.serve_forever() -- 2.1.4