changeset 9:16689c948bbc

Rename the instance variable plant to pkg_line in some classes
author Bernhard Herzog <bh@intevation.de>
date Fri, 09 Mar 2007 15:02:41 +0100
parents 574506a022f6
children 59d6055493f5
files enterprise/kdei18n.py treepkg/packager.py
diffstat 2 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/enterprise/kdei18n.py	Fri Mar 09 14:48:58 2007 +0100
+++ b/enterprise/kdei18n.py	Fri Mar 09 15:02:41 2007 +0100
@@ -49,7 +49,7 @@
         return version_template % locals()
 
     def unpack_orig_tarball(self):
-        orig_tarball = self.plant.orig_tarball
+        orig_tarball = self.pkg_line.orig_tarball
         run.call(["tar", "xjf", orig_tarball, "-C", self.work_dir])
         tarbasename = os.path.basename(orig_tarball)
         splitext = os.path.splitext
--- a/treepkg/packager.py	Fri Mar 09 14:48:58 2007 +0100
+++ b/treepkg/packager.py	Fri Mar 09 15:02:41 2007 +0100
@@ -30,8 +30,8 @@
     # Derived classes must supply the package basename
     pkg_basename = None
 
-    def __init__(self, plant, status, work_dir, src_dir, revision):
-        self.plant = plant
+    def __init__(self, pkg_line, status, work_dir, src_dir, revision):
+        self.pkg_line = pkg_line
         self.status = status
         self.work_dir = work_dir
         self.src_dir = src_dir
@@ -62,7 +62,7 @@
         is the return value of the determine_package_version() method.
         """
         temp_dir = os.path.join(self.work_dir, "temp")
-        self.plant.export_sources(temp_dir)
+        self.pkg_line.export_sources(temp_dir)
 
         pkgbaseversion = self.determine_package_version(temp_dir)
         pkgbasedir = os.path.join(self.work_dir,
@@ -111,7 +111,7 @@
         debian_dir = os.path.join(pkgbasedir, "debian")
         changelog = os.path.join(debian_dir, "changelog")
 
-        self.plant.copy_debian_directory(debian_dir)
+        self.pkg_line.copy_debian_directory(debian_dir)
 
         logging.info("Updating %r", changelog)
         oldversion = util.debian_changelog_version(changelog)
@@ -122,7 +122,7 @@
         run.call(["debchange", "-c", changelog,
                   "-v", oldversionprefix + pkgbaseversion + "-kk1",
                   changemsg],
-                 env=self.plant.debian_environment())
+                 env=self.pkg_line.debian_environment())
 
 
     def create_source_package(self, pkgbasedir, origtargz):
@@ -132,7 +132,7 @@
                   os.path.basename(origtargz)],
                  cwd=os.path.dirname(pkgbasedir),
                  suppress_output=True,
-                 env=self.plant.debian_environment())
+                 env=self.pkg_line.debian_environment())
 
     def move_source_package(self, pkgbasename):
         """Moves the new source package from the work_dir to the src_dir"""
@@ -172,8 +172,8 @@
 
 class BinaryPackager(object):
 
-    def __init__(self, plant, status, binary_dir, dsc_file, logfile):
-        self.plant = plant
+    def __init__(self, pkg_line, status, binary_dir, dsc_file, logfile):
+        self.pkg_line = pkg_line
         self.status = status
         self.binary_dir = binary_dir
         self.dsc_file = dsc_file
@@ -185,7 +185,7 @@
         logging.info("Building binary package; loging to %r", self.logfile)
         cmd = ["/usr/sbin/pbuilder", "build", "--logfile", self.logfile,
                "--buildresult", self.binary_dir, self.dsc_file]
-        run.call(self.plant.root_cmd + cmd, suppress_output=True)
+        run.call(self.pkg_line.root_cmd + cmd, suppress_output=True)
         self.status.set("binary_package_created")
 
 
@@ -194,10 +194,10 @@
     source_packager_cls = SourcePackager
     binary_packager_cls = BinaryPackager
 
-    def __init__(self, plant, revision):
-        self.plant = plant
+    def __init__(self, pkg_line, revision):
+        self.pkg_line = pkg_line
         self.revision = revision
-        self.base_dir = self.plant.pkg_dir_for_revision(self.revision, 1)
+        self.base_dir = self.pkg_line.pkg_dir_for_revision(self.revision, 1)
         self.status = util.StatusFile(os.path.join(self.base_dir, "status"))
 
     work_dir = _filenameproperty("work")
@@ -212,7 +212,7 @@
 
     def package(self):
         try:
-            src_packager = self.source_packager_cls(self.plant, self.status,
+            src_packager = self.source_packager_cls(self.pkg_line, self.status,
                                                     self.work_dir, self.src_dir,
                                                     self.revision)
             src_packager.package()
@@ -221,7 +221,7 @@
             if dsc_file is None:
                 raise RuntimeError("Cannot find dsc File in %r" % self.src_dir)
 
-            bin_packager = self.binary_packager_cls(self.plant, self.status,
+            bin_packager = self.binary_packager_cls(self.pkg_line, self.status,
                                                     self.binary_dir, dsc_file,
                                                     os.path.join(self.base_dir,
                                                                  "build.log"))
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)