Moved the tutorial into the campaigns directory.

This commit is contained in:
Eric S. Raymond 2007-05-11 12:44:27 +00:00
parent d946916a0a
commit d95532a390
34 changed files with 17 additions and 10 deletions

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -95,16 +95,11 @@ if __name__ == "__main__":
cref = wmltools.CrossRef(".", exclude="icons/|tutorial/")
# Filter reference information on all files referenced in the source .cfgs
for name in cref.fileref.keys():
for referenced in cref.fileref[name].references:
if os.path.basename(referenced) in map(os.path.basename, srclist):
break
else:
del cref.fileref[name]
srcrefs = cref.subtract(filelist)
# List all relevant resources and their other references
if listem:
for (name, defloc) in cref.fileref.items():
for (name, defloc) in srcref.fileref.items():
print "Resource %s is used in %d files:" % \
(defloc, len(defloc.references))
defloc.dump_references()

View File

@ -40,6 +40,7 @@ class Forest:
"Are two files from the same tree?"
return self.clique[fn1] == self.clique[fn2]
def flatten(self):
"Return a flattened list of all files in the forest."
allfiles = []
for tree in self.forest:
allfiles += tree
@ -131,7 +132,7 @@ class CrossRef:
# coloring logic to simulate include path interpretation.
# If that logic ever gets built, it will go here.
return True
def __init__(self, dirpath, exclude="", warnlevel=0):
def __init__(self, dirpath=[], exclude="", warnlevel=0):
"Build cross-reference object from the specified filelist."
self.dirpath = dirpath
self.filelist = Forest(dirpath, exclude)
@ -198,8 +199,7 @@ class CrossRef:
dfp = open(filename)
for line in dfp:
self.xref[line.strip()] = True
dfp.close()
dfp.close()
# Next, decorate definitions with all references from the filelist.
self.unresolved = []
self.missing = []
@ -262,6 +262,18 @@ class CrossRef:
if not key:
self.missing.append((name, Reference(fn,n+1)))
rfp.close()
def subtract(self, filelist):
"Remove file references in files in filelist."
smallref = CrossRef()
for filename in self.fileref:
for ref in self.fileref[filename]:
if ref.filename in filelist:
if filename not in smallref.fileref:
smallref.fileref[filename] = []
smallref.fileref[filename].append(ref.filename)
ref.filename = None
self.fileref[filename] = filter(lambda ref: ref.filename, self.fileref[filename])
return smallref
## Version-control hooks begin here.
#