mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-16 09:31:08 +00:00
* lpapiwrapper.py:
- Move getUbuntuArchive() from LpApiWrapper to Distribution and rename it to getMainArchive()
This commit is contained in:
parent
046798d12b
commit
30915541e4
@ -84,15 +84,6 @@ class LpApiWrapper(object):
|
|||||||
'''
|
'''
|
||||||
return Distribution('ubuntu')
|
return Distribution('ubuntu')
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def getUbuntuArchive(cls):
|
|
||||||
'''
|
|
||||||
Returns the LP representation for the Ubuntu main archive.
|
|
||||||
'''
|
|
||||||
if not cls._archive:
|
|
||||||
cls._archive = cls.getUbuntuDistribution().main_archive
|
|
||||||
return cls._archive
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def getUbuntuSeries(cls, name_or_version):
|
def getUbuntuSeries(cls, name_or_version):
|
||||||
'''
|
'''
|
||||||
@ -148,7 +139,7 @@ class LpApiWrapper(object):
|
|||||||
|
|
||||||
if (name, series, pocket) not in cls._src_pkg:
|
if (name, series, pocket) not in cls._src_pkg:
|
||||||
try:
|
try:
|
||||||
srcpkg = cls.getUbuntuArchive().getPublishedSources(
|
srcpkg = cls.getUbuntuDistribution().getMainArchive().getPublishedSources(
|
||||||
source_name = name, distro_series = series._lpobject, pocket = pocket,
|
source_name = name, distro_series = series._lpobject, pocket = pocket,
|
||||||
status = 'Published', exact_match = True)[0]
|
status = 'Published', exact_match = True)[0]
|
||||||
cls._src_pkg[(name, series, pocket)] = SourcePackage(srcpkg)
|
cls._src_pkg[(name, series, pocket)] = SourcePackage(srcpkg)
|
||||||
@ -192,7 +183,7 @@ class LpApiWrapper(object):
|
|||||||
|
|
||||||
if component not in cls._upload_comp and package not in cls._upload_pkg:
|
if component not in cls._upload_comp and package not in cls._upload_pkg:
|
||||||
me = cls.getMe()
|
me = cls.getMe()
|
||||||
archive = cls.getUbuntuArchive()
|
archive = cls.getUbuntuDistribution().getMainArchive()
|
||||||
for perm in archive.getPermissionsForPerson(person = me()):
|
for perm in archive.getPermissionsForPerson(person = me()):
|
||||||
if perm.permission != 'Archive Upload Rights':
|
if perm.permission != 'Archive Upload Rights':
|
||||||
continue
|
continue
|
||||||
@ -308,6 +299,14 @@ class Distribution(BaseWrapper):
|
|||||||
cached = Distribution(Launchpad.distributions[dist])
|
cached = Distribution(Launchpad.distributions[dist])
|
||||||
return cached
|
return cached
|
||||||
|
|
||||||
|
def getMainArchive(self):
|
||||||
|
'''
|
||||||
|
Returns the LP representation for the Ubuntu main archive.
|
||||||
|
'''
|
||||||
|
if not '_archive' in self.__dict__:
|
||||||
|
self._archive = self.main_archive
|
||||||
|
return self._archive
|
||||||
|
|
||||||
|
|
||||||
class DistroSeries(BaseWrapper):
|
class DistroSeries(BaseWrapper):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user