Commit 6c314aaa authored by Greg Ward's avatar Greg Ward

Added class docstring and ditched inappropriate class attrs.

Indentation/whitspace fixes.
parent 88d73d6b
......@@ -19,15 +19,19 @@ from distutils.util import convert_path
class FileList:
files = None # reference to files list to mainpulate
allfiles = None # list of all files, if None will be filled
# at first use from directory self.dir
dir = None # directory from which files will be taken
# to fill self.allfiles if it was not set otherwise
# next both functions (callable objects) can be set by the user
# warn: warning function
# debug_print: debug function
"""A list of files built by on exploring the filesystem and filtered by
applying various patterns to what we find there.
Instance attributes:
dir
directory from which files will be taken -- only used if
'allfiles' not supplied to constructor
files
list of filenames currently being built/filtered/manipulated
allfiles
complete list of files under consideration (ie. without any
filtering applied)
"""
def __init__(self,
files=[],
......@@ -42,13 +46,14 @@ class FileList:
self.debug_print = debug_print
self.files = files
self.dir = dir
# if None, 'allfiles' will be filled when used for first time
self.allfiles = allfiles
# if None, it will be filled, when used for first time
# standard warning and debug functions, if no other given
def __warn (self, msg):
sys.stderr.write ("warning: template: %s\n" % msg)
sys.stderr.write ("warning: %s\n" % msg)
def __debug_print (self, msg):
"""Print 'msg' to stdout if the global DEBUG (taken from the
......@@ -59,7 +64,7 @@ class FileList:
print msg
def process_line(self, line):
def process_line (self, line):
words = string.split (line)
action = words[0]
......@@ -181,8 +186,6 @@ class FileList:
# process_line ()
def select_pattern (self, pattern,
anchor=1, prefix=None, is_regex=0):
"""Select strings (presumably filenames) from 'files' that match
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment