changeset 52:78cf5f6778ec

Rename 'packagel ine' -> 'package track'
author Bernhard Herzog <bh@intevation.de>
date Tue, 03 Apr 2007 20:33:33 +0200
parents 225206553bba
children 74cd21b6400b
files enterprise/kdei18n.py enterprise/kdepim.py initpbuilder.py runtreepkg.py treepkg/packager.py treepkg/readconfig.py treepkg/report.py treepkg/web.py
diffstat 8 files changed, 55 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/enterprise/kdei18n.py	Tue Apr 03 11:24:48 2007 +0200
+++ b/enterprise/kdei18n.py	Tue Apr 03 20:33:33 2007 +0200
@@ -49,7 +49,7 @@
         return version_template % locals()
 
     def unpack_orig_tarball(self):
-        orig_tarball = self.pkg_line.orig_tarball
+        orig_tarball = self.pkg_track.orig_tarball
         run.call(["tar", "xjf", orig_tarball, "-C", self.work_dir])
         tarbasename = os.path.basename(orig_tarball)
         splitext = os.path.splitext
@@ -122,7 +122,7 @@
     source_packager_cls = SourcePackager
 
 
-class PackageLine(treepkg.packager.PackageLine):
+class PackageTrack(treepkg.packager.PackageTrack):
 
     revision_packager_cls = RevisionPackager
 
@@ -132,5 +132,5 @@
 
     def __init__(self, *args, **kw):
         self.orig_tarball = kw.pop("orig_tarball")
-        super(PackageLine, self).__init__(*args, **kw)
+        super(PackageTrack, self).__init__(*args, **kw)
 
--- a/enterprise/kdepim.py	Tue Apr 03 11:24:48 2007 +0200
+++ b/enterprise/kdepim.py	Tue Apr 03 20:33:33 2007 +0200
@@ -75,7 +75,7 @@
     source_packager_cls = SourcePackager
 
 
-class PackageLine(treepkg.packager.PackageLine):
+class PackageTrack(treepkg.packager.PackageTrack):
 
     revision_packager_cls = RevisionPackager
 
--- a/initpbuilder.py	Tue Apr 03 11:24:48 2007 +0200
+++ b/initpbuilder.py	Tue Apr 03 20:33:33 2007 +0200
@@ -17,7 +17,7 @@
 import os
 from optparse import OptionParser
 
-from treepkg.packager import create_package_line, PackagerGroup
+from treepkg.packager import create_package_track, PackagerGroup
 from treepkg.readconfig import read_config
 from treepkg.util import ensure_directory, writefile
 from treepkg.run import call
@@ -115,14 +115,14 @@
         sys.exit(1)
 
     treepkg_opts, packager_opts = read_config(options.config_file)
-    group = PackagerGroup([create_package_line(**opts)
+    group = PackagerGroup([create_package_track(**opts)
                            for opts in packager_opts],
                           **treepkg_opts)
-    pkg_line = group.get_package_lines()[0]
-    init_pbuilder(pkg_line.pbuilderrc,
+    track = group.get_package_tracks()[0]
+    init_pbuilder(track.pbuilderrc,
                   distribution=options.distribution,
                   mirrorsite=options.mirrorsite,
                   extramirrors=options.othermirror,
-                  root_cmd=pkg_line.root_cmd)
+                  root_cmd=track.root_cmd)
 
 main()
--- a/runtreepkg.py	Tue Apr 03 11:24:48 2007 +0200
+++ b/runtreepkg.py	Tue Apr 03 20:33:33 2007 +0200
@@ -13,7 +13,7 @@
 import logging
 from optparse import OptionParser
 
-from treepkg.packager import create_package_line, PackagerGroup
+from treepkg.packager import create_package_track, PackagerGroup
 from treepkg.readconfig import read_config
 
 def initialize_logging():
@@ -53,14 +53,14 @@
             if name in args:
                 args.remove(name)
         for name in args:
-            print >>sys.stderr, "No package lines found named %r" % name
+            print >>sys.stderr, "No package tracks found named %r" % name
 
     if packager_opts:
-        group = PackagerGroup([create_package_line(**opts)
+        group = PackagerGroup([create_package_track(**opts)
                                for opts in packager_opts],
                               **treepkg_opts)
         if options.once:
-            group.check_package_lines()
+            group.check_package_tracks()
         else:
             group.run()
 
--- a/treepkg/packager.py	Tue Apr 03 11:24:48 2007 +0200
+++ b/treepkg/packager.py	Tue Apr 03 20:33:33 2007 +0200
@@ -32,8 +32,8 @@
     # Derived classes must supply the package basename
     pkg_basename = None
 
-    def __init__(self, pkg_line, status, work_dir, src_dir, revision):
-        self.pkg_line = pkg_line
+    def __init__(self, pkg_track, status, work_dir, src_dir, revision):
+        self.pkg_track = pkg_track
         self.status = status
         self.work_dir = work_dir
         self.src_dir = src_dir
@@ -64,7 +64,7 @@
         is the return value of the determine_package_version() method.
         """
         temp_dir = os.path.join(self.work_dir, "temp")
-        self.pkg_line.export_sources(temp_dir)
+        self.pkg_track.export_sources(temp_dir)
 
         pkgbaseversion = self.determine_package_version(temp_dir)
         pkgbasedir = os.path.join(self.work_dir,
@@ -113,7 +113,7 @@
         debian_dir = os.path.join(pkgbasedir, "debian")
         changelog = os.path.join(debian_dir, "changelog")
 
-        self.pkg_line.copy_debian_directory(debian_dir)
+        self.pkg_track.copy_debian_directory(debian_dir)
 
         logging.info("Updating %r", changelog)
         oldversion = util.debian_changelog_version(changelog)
@@ -124,7 +124,7 @@
         run.call(["debchange", "-c", changelog,
                   "-v", oldversionprefix + pkgbaseversion + "-kk1",
                   changemsg],
-                 env=self.pkg_line.debian_environment())
+                 env=self.pkg_track.debian_environment())
 
 
     def create_source_package(self, pkgbasedir, origtargz):
@@ -134,7 +134,7 @@
                   os.path.basename(origtargz)],
                  cwd=os.path.dirname(pkgbasedir),
                  suppress_output=True,
-                 env=self.pkg_line.debian_environment())
+                 env=self.pkg_track.debian_environment())
 
     def move_source_package(self, pkgbasename):
         """Moves the new source package from the work_dir to the src_dir"""
@@ -174,8 +174,8 @@
 
 class BinaryPackager(object):
 
-    def __init__(self, pkg_line, status, binary_dir, dsc_file, logfile):
-        self.pkg_line = pkg_line
+    def __init__(self, pkg_track, status, binary_dir, dsc_file, logfile):
+        self.pkg_track = pkg_track
         self.status = status
         self.binary_dir = binary_dir
         self.dsc_file = dsc_file
@@ -186,10 +186,10 @@
         util.ensure_directory(self.binary_dir)
         logging.info("Building binary package; loging to %r", self.logfile)
         cmd = ["/usr/sbin/pbuilder", "build",
-               "--configfile", self.pkg_line.pbuilderrc,
+               "--configfile", self.pkg_track.pbuilderrc,
                "--logfile", self.logfile,
                "--buildresult", self.binary_dir, self.dsc_file]
-        run.call(self.pkg_line.root_cmd + cmd, suppress_output=True)
+        run.call(self.pkg_track.root_cmd + cmd, suppress_output=True)
         self.status.binary_package_created()
 
 
@@ -198,10 +198,10 @@
     source_packager_cls = SourcePackager
     binary_packager_cls = BinaryPackager
 
-    def __init__(self, pkg_line, revision):
-        self.pkg_line = pkg_line
+    def __init__(self, pkg_track, revision):
+        self.pkg_track = pkg_track
         self.revision = revision
-        self.base_dir = self.pkg_line.pkg_dir_for_revision(self.revision, 1)
+        self.base_dir = self.pkg_track.pkg_dir_for_revision(self.revision, 1)
         self.status = status.RevisionStatus(os.path.join(self.base_dir,
                                                          "status"))
 
@@ -223,7 +223,7 @@
         try:
             util.ensure_directory(self.work_dir)
             self.status.start = datetime.datetime.utcnow()
-            src_packager = self.source_packager_cls(self.pkg_line, self.status,
+            src_packager = self.source_packager_cls(self.pkg_track, self.status,
                                                     self.work_dir, self.src_dir,
                                                     self.revision)
             src_packager.package()
@@ -232,7 +232,7 @@
             if dsc_file is None:
                 raise RuntimeError("Cannot find dsc File in %r" % self.src_dir)
 
-            bin_packager = self.binary_packager_cls(self.pkg_line, self.status,
+            bin_packager = self.binary_packager_cls(self.pkg_track, self.status,
                                                     self.binary_dir, dsc_file,
                                                     self.build_log)
             bin_packager.package()
@@ -247,7 +247,7 @@
         shutil.rmtree(self.base_dir)
 
 
-class PackageLine(object):
+class PackageTrack(object):
 
     revision_packager_cls = RevisionPackager
 
@@ -364,15 +364,15 @@
                 for revision in self.get_revision_numbers()]
 
 
-def create_package_line(packager_class, **kw):
+def create_package_track(packager_class, **kw):
     module = util.import_dotted_name(packager_class)
-    return module.PackageLine(**kw)
+    return module.PackageTrack(**kw)
 
 
 class PackagerGroup(object):
 
-    def __init__(self, package_lines, check_interval):
-        self.package_lines = package_lines
+    def __init__(self, package_tracks, check_interval):
+        self.package_tracks = package_tracks
         self.check_interval = check_interval
 
     def run(self):
@@ -383,7 +383,7 @@
         while 1:
             now = time.time()
             if now > last_check + self.check_interval:
-                self.check_package_lines()
+                self.check_package_tracks()
                 last_check = now
                 next_check = now + self.check_interval
                 to_sleep = next_check - time.time()
@@ -395,17 +395,17 @@
                 else:
                     logging.info("Next check now")
 
-    def check_package_lines(self):
-        logging.info("Checking package lines")
-        for line in self.package_lines:
+    def check_package_tracks(self):
+        logging.info("Checking package tracks")
+        for track in self.package_tracks:
             try:
-                packager = line.package_if_updated()
+                packager = track.package_if_updated()
                 if packager:
                     packager.package()
             except:
                 logging.exception("An error occurred while"
-                                  " checking packager line %r", line.name)
-        logging.info("Checked all package lines")
+                                  " checking packager track %r", track.name)
+        logging.info("Checked all package tracks")
 
-    def get_package_lines(self):
-        return self.package_lines
+    def get_package_tracks(self):
+        return self.package_tracks
--- a/treepkg/readconfig.py	Tue Apr 03 11:24:48 2007 +0200
+++ b/treepkg/readconfig.py	Tue Apr 03 20:33:33 2007 +0200
@@ -63,7 +63,7 @@
         if section.startswith("pkg_"):
             packager_class = parser.get(section, "packager_class")
             module = util.import_dotted_name(packager_class)
-            desc = packager_desc + module.PackageLine.extra_config_desc
+            desc = packager_desc + module.PackageTrack.extra_config_desc
             packagers.append(read_config_section(parser, section, desc,
                                                  dict(name=section[4:])))
 
--- a/treepkg/report.py	Tue Apr 03 11:24:48 2007 +0200
+++ b/treepkg/report.py	Tue Apr 03 20:33:33 2007 +0200
@@ -7,7 +7,7 @@
 
 """Support for status reports"""
 
-from packager import create_package_line, PackagerGroup
+from packager import create_package_track, PackagerGroup
 from readconfig import read_config
 
 class struct(object):
@@ -28,7 +28,7 @@
 
 def get_packager_group(config_file):
     treepkg_opts, packager_opts = read_config(config_file)
-    return PackagerGroup([create_package_line(**opts)
+    return PackagerGroup([create_package_track(**opts)
                           for opts in packager_opts],
                          **treepkg_opts)
 
@@ -64,16 +64,16 @@
 def prepare_report(group):
     revisions = {}
     columns = []
-    pkglines = group.get_package_lines()
-    num_columns = len(pkglines)
-    for column, line in enumerate(pkglines):
-        columns.append((column, line.name))
-        for revision in line.get_revisions():
+    tracks = group.get_package_tracks()
+    num_columns = len(tracks)
+    for column, track in enumerate(tracks):
+        columns.append((column, track.name))
+        for revision in track.get_revisions():
             row = revisions.setdefault(revision.revision, [None] * num_columns)
             row[column] = struct(revno=revision.revision,
                                  revision=revision,
                                  column=column,
-                                 name=line.name,
+                                 name=track.name,
                                  status=prepare_status(revision.status))
 
     # convert the revisions dict into a sorted list of (revno, row)
--- a/treepkg/web.py	Tue Apr 03 11:24:48 2007 +0200
+++ b/treepkg/web.py	Tue Apr 03 20:33:33 2007 +0200
@@ -31,12 +31,12 @@
         stream = tmpl.generate(report=report.prepare_report(group))
         return stream.render('html')
 
-    def build_log_filename(self, package_line_name, revno):
+    def build_log_filename(self, package_track_name, revno):
         """Returns the name of the build log file of a revision if it exists"""
         group = report.get_packager_group(self.treepkg_config)
-        for line in group.get_package_lines():
-            if line.name == package_line_name:
-                for revision in line.get_revisions():
+        for track in group.get_package_tracks():
+            if track.name == package_track_name:
+                for revision in track.get_revisions():
                     if str(revision.revision) == revno:
                         if revision.has_build_log():
                             return revision.build_log
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)