summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2008-06-04 00:38:14 +0200
committerSean Finney <seanius@debian.org>2008-06-04 00:38:14 +0200
commit3f503aa3ae6103a2e7c326c1a1bd9bf339327d13 (patch)
tree4444beee825fc343fd31a8185c14285635fbdf20
parent06cb3e7863070f65cbfb29f51f98426bf1156b7e (diff)
downloadpatch-tracker-3f503aa3ae6103a2e7c326c1a1bd9bf339327d13.tar.gz
most modulizing cleanup and guts-hiding
-rwxr-xr-xgen-patch-info.py16
-rwxr-xr-xpatchtracker/Writers.py25
2 files changed, 18 insertions, 23 deletions
diff --git a/gen-patch-info.py b/gen-patch-info.py
index 1a84372..da82645 100755
--- a/gen-patch-info.py
+++ b/gen-patch-info.py
@@ -1,17 +1,9 @@
#!/usr/bin/python
import os
-import errno
-import string
-import tempfile
-from fnmatch import fnmatch
-from gzip import GzipFile
-from debian_bundle import deb822
-from Cheetah.Template import Template
-from Cheetah.Compiler import Compiler
import patchtracker.Conf as Conf
-from patchtracker.Writers import LetterTocWriter, LetterTocTemplate, FrontPageWriter, FrontPageTemplate, PackageVersWriter, PackageVersTemplate
+from patchtracker.Writers import LetterTocWriter, FrontPageWriter, PackageVersWriter
from patchtracker.SourceArchive import Archive, SourcePackage, SourcePackageIndex
if __name__ == '__main__':
@@ -30,10 +22,10 @@ if __name__ == '__main__':
print "\tcomponent:",c
for p in a.sourcepackages(s, c):
print "\t\tpackage:",p
- PackageVersWriter(PackageVersTemplate(p, s))
+ PackageVersWriter(p, s)
master_index.ins(p,s)
os.system("cp -a "+Conf.static_dir+"/* "+Conf.output_dir)
- FrontPageWriter(FrontPageTemplate(master_index))
+ FrontPageWriter(master_index)
for letter,stuff in master_index.indices():
- LetterTocWriter(LetterTocTemplate(letter,stuff))
+ LetterTocWriter(letter,stuff)
diff --git a/patchtracker/Writers.py b/patchtracker/Writers.py
index 7e2d356..8837d51 100755
--- a/patchtracker/Writers.py
+++ b/patchtracker/Writers.py
@@ -59,25 +59,28 @@ class PageWriter:
o.close()
class PackageVersWriter(PageWriter):
- def __init__(self, template):
- dstdir = os.sep.join([Conf.output_dir, "packages", template.src.name, template.src.version])
+ def __init__(self, srcpkg, suite):
+ t = PackageVersTemplate(srcpkg,suite)
+ dstdir = os.sep.join([Conf.output_dir, "packages", t.src.name, t.src.version])
try:
os.makedirs(dstdir)
except OSError, e:
if e.errno != errno.EEXIST:
raise e
- template.src.diff_debiandir(dstdir)
- template.src.diff_nondebiandir(dstdir)
- template.src.diff_series(dstdir)
+ t.src.diff_debiandir(dstdir)
+ t.src.diff_nondebiandir(dstdir)
+ t.src.diff_series(dstdir)
dst = os.sep.join([dstdir, "index.html"])
- PageWriter.__init__(self, dst, template)
+ PageWriter.__init__(self, dst, t)
class FrontPageWriter(PageWriter):
- def __init__(self, template):
+ def __init__(self, allindex, release_indices=[]):
+ t = FrontPageTemplate(allindex, release_indices)
dest = os.sep.join([Conf.output_dir, "index.html"])
- PageWriter.__init__(self, dest, template)
+ PageWriter.__init__(self, dest, t)
class LetterTocWriter(PageWriter):
- def __init__(self, template):
- dest = os.sep.join([Conf.output_dir, "index", template.idx, "index.html"])
- PageWriter.__init__(self, dest, template)
+ def __init__(self, letter, collection):
+ t = LetterTocTemplate(letter, collection)
+ dest = os.sep.join([Conf.output_dir, "index", t.idx, "index.html"])
+ PageWriter.__init__(self, dest, t)