From 263b6db940feff63d5a9f716b94d8041dc0c63f8 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Thu, 20 May 2010 00:59:23 +0200 Subject: [PATCH] Aggiustato qualche commento. --- pywhois.py | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/pywhois.py b/pywhois.py index f55d388..8d08f59 100644 --- a/pywhois.py +++ b/pywhois.py @@ -28,9 +28,10 @@ def FormatMessage(message): class Logger(): - # - # Logger class that allow pywhoisd to log - # everything on syslog. + """ + Logger class that allow pywhoisd to log + everything on syslog. + """ def __init__(self, verbose = False): self.verbose = verbose @@ -44,11 +45,11 @@ class Logger(): self.Log (message) class Config(): - # - # Config class manage configuration contained - # in the config file and acts like a dictionary - # that provides data to other classes - # + """ + Config class manage configuration contained + in the config file and acts like a dictionary + that provides data to other classes + """ def __init__(self, config_file): """ Load config file and save data in memory @@ -72,7 +73,8 @@ class Config(): class WhoisRequestHandler(SocketServer.StreamRequestHandler): """ - This handler answers to the whois request + This handler answers to the whois request that + arrives to the WhoisServer. """ def handle(self): @@ -97,9 +99,10 @@ class WhoisRequestHandler(SocketServer.StreamRequestHandler): class WhoisServer(SocketServer.ThreadingTCPServer): - # - # The real server. We allow reusing of address - # so we can stop and start in a moment. + """ + The real server. We allow reusing of address + so we can stop and start in a moment. + """ allow_reuse_address = True def __init__(self, (host, port), logger, config): @@ -241,13 +244,13 @@ class WhoisServer(SocketServer.ThreadingTCPServer): return interesting_networks class Net(): - # - # Net is a class representing the network - # contained in the local database and the - # net obtained from other whois server. - # - # It act as a C struct containing only the - # data and no method. + """ + Net is a class representing the network + contained in the local database and the + net obtained from other whois server. + It act as a C struct containing only the + data and no method. + """ def __init__(self, name, owner, ns, data): self.name = name self.owner = owner @@ -255,9 +258,9 @@ class Net(): self.data = data class Domain(): - # - # - # + """ + The same of Net, but with the domain names. + """ def __init__(self, name, owner, ns, data): self.name, self.owner, self.ns = name, owner, ns self.data = data -- 2.1.4