From 25c6aa2221fa7294e253ca540aa1eb58f447459d Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Sun, 31 Dec 2006 14:50:04 -0800 Subject: [PATCH] Remove inappropriate class variables, add instance variable documentation 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 --- RarslaveLogger.py | 10 ++++++++++ rarslave.py | 24 ++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/RarslaveLogger.py b/RarslaveLogger.py index d60b105..ae39913 100644 --- a/RarslaveLogger.py +++ b/RarslaveLogger.py @@ -8,6 +8,12 @@ class MessageType (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 @@ -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. + # Instance Variables: + # ========================================================================== + # __messages -- The list of RarslaveMessage()s to be printed later. + def __init__ (self): self.__messages = [] diff --git a/rarslave.py b/rarslave.py index 97a100a..0d25883 100644 --- a/rarslave.py +++ b/rarslave.py @@ -20,8 +20,14 @@ options = None 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): @@ -223,12 +229,14 @@ class RarslaveExtractor (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) -- 2.25.1