move copyPackage into lpapicache for better encapsulation

This commit is contained in:
Colin Watson 2011-08-16 18:07:58 +01:00
parent ecaaa33fdc
commit f8d4866cbc
2 changed files with 20 additions and 4 deletions

View File

@ -340,7 +340,7 @@ def copy(src_pkg, debian_version, release, simulate=False):
ubuntu_archive.copyPackage(
source_name=src_pkg,
version=debian_version,
from_archive=debian_archive.lp_object(),
from_archive=debian_archive,
to_series=ubuntu_series,
to_pocket=ubuntu_pocket,
include_binaries=False)

View File

@ -172,9 +172,6 @@ class BaseWrapper(object):
else:
return '<%s: %r>' % (self.__class__.__name__, self._lpobject)
def lp_object(self):
return self._lpobject
class Distribution(BaseWrapper):
'''
@ -335,6 +332,25 @@ class Archive(BaseWrapper):
return self._srcpkgs[(name, series.name, pocket)]
def copyPackage(self, source_name, version, from_archive, to_pocket,
to_series = None, include_binaries = False):
'''Copy a single named source into this archive.
Asynchronously copy a specific version of a named source to the
destination archive if necessary. Calls to this method will return
immediately if the copy passes basic security checks and the copy
will happen sometime later with full checking.
'''
self._lpobject.copyPackage(
source_name=source_name,
version=version,
from_archive=from_archive._lpobject,
to_pocket=to_pocket,
to_series=to_series,
include_binaries=include_binaries
)
class SourcePackagePublishingHistory(BaseWrapper):
'''