Aggiustato qualche commento.

Leonardo [2010-05-19 22:59]
Aggiustato qualche commento.
Filename
pywhois.py
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
ViewGit