Remove inappropriate class variables, add instance variable documentation
authorIra W. Snyder <devel@irasnyder.com>
Sun, 31 Dec 2006 22:50:04 +0000 (14:50 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Sun, 31 Dec 2006 22:50:04 +0000 (14:50 -0800)
Removes all of the improperly used class variables.

In their place, adds documentation for all of the instance variables that
should be used throughout the life of each instance of a class.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
RarslaveLogger.py
rarslave.py

index d60b105..ae39913 100644 (file)
@@ -8,6 +8,12 @@ class MessageType (object):
        Debug = 2
 
 class RarslaveMessage (object):
        Debug = 2
 
 class RarslaveMessage (object):
+
+       # Instance Variables:
+       # ==========================================================================
+       # msg   -- The message to be printed
+       # type  -- The type of message (Fatal, Normal, Verbose, or Debug)
+
        def __init__ (self, msg, type=MessageType.Normal):
                self.msg = msg
                self.type = type
        def __init__ (self, msg, type=MessageType.Normal):
                self.msg = msg
                self.type = type
@@ -31,6 +37,10 @@ class RarslaveLogger (object):
        # This class will log multiple messages, one for each set that is operated on.
        # It will then be able to print all of them out.
 
        # This class will log multiple messages, one for each set that is operated on.
        # It will then be able to print all of them out.
 
+       # Instance Variables:
+       # ==========================================================================
+       # __messages    -- The list of RarslaveMessage()s to be printed later.
+
        def __init__ (self):
                self.__messages = []
 
        def __init__ (self):
                self.__messages = []
 
index 97a100a..0d25883 100644 (file)
@@ -20,8 +20,14 @@ options = None
 
 class RarslaveExtractor (object):
 
 
 class RarslaveExtractor (object):
 
-       type = None
-       heads = []
+       # Instance Variables
+       # ==========================================================================
+       # dir                                   -- The directory in which this set lives
+       # p2files                               -- All PAR2 files in this set
+       # name_matched_files    -- Files in this set, matched by name only
+       # prot_matched_files    -- Files in this set, matched by parsing PAR2 files only
+       # type                                  -- This set's type
+       # heads                                 -- The heads to be extracted
 
        def __init__ (self, dir, p2files, name_files, prot_files):
 
 
        def __init__ (self, dir, p2files, name_files, prot_files):
 
@@ -223,12 +229,14 @@ class RarslaveExtractor (object):
 
 class PAR2Set (object):
 
 
 class PAR2Set (object):
 
-       dir = None
-       p2file = None # The starting par2
-       basename = None # The p2file's basename
-       all_p2files = []
-       name_matched_files = [] # Files that match by basename of the p2file
-       prot_matched_files = [] # Files that match by being protected members
+       # Instance Variables
+       # ==========================================================================
+       # dir                                   -- The directory this set lives in
+       # p2file                                -- The starting PAR2 file
+       # basename                              -- The basename of the set, guessed from the PAR2 file
+       # all_p2files                   -- All PAR2 files of the set, guessed from the PAR2 file name only
+       # name_matched_files    -- Files in this set, guessed by name only
+       # prot_matched_files    -- Files in this set, guessed by parsing the PAR2 only
 
        def __init__ (self, dir, p2file):
                assert os.path.isdir (dir)
 
        def __init__ (self, dir, p2file):
                assert os.path.isdir (dir)