Logo Search packages:      
Sourcecode: ubuntu-dev-tools version File versions  Download package

def ubuntutools::lp::lpapicache::PersonTeam::canUploadPackage (   self,
  archive,
  distroseries,
  package,
  component,
  pocket = 'Release' 
)

Check if the person or team has upload rights for the source
package to the specified 'archive' and 'distrorelease'.

A source package name and a component have to be specified.
'archive' has to be a Archive object.
'distroseries' has to be an DistroSeries object.

Definition at line 441 of file lpapicache.py.

00441                                                                                              :
            '''Check if the person or team has upload rights for the source
            package to the specified 'archive' and 'distrorelease'.

            A source package name and a component have to be specified.
            'archive' has to be a Archive object.
            'distroseries' has to be an DistroSeries object.
            '''
            if not isinstance(archive, Archive):
                  raise TypeError("'%r' is not an Archive object." % archive)
            if not isinstance(distroseries, DistroSeries):
                  raise TypeError("'%r' is not a DistroSeries object." % distroseries)
            if package is not None and not isinstance(package, basestring):
                  raise TypeError('A source package name expected.')
            if component is not None and not isinstance(component, basestring):
                  raise TypeError('A component name expected.')
            if package is None and component is None:
                  raise ValueError('Either a source package name or a component has to be specified.')
            if pocket not in ('Release', 'Security', 'Updates', 'Proposed', 'Backports'):
                  raise PocketDoesNotExistError("Pocket '%s' does not exist." % pocket)

            canUpload = self._upload.get((archive, distroseries, pocket, package, component))

            if canUpload is None:
                  # checkUpload() throws an exception if the person can't upload
                  try:
                        archive.checkUpload(
                                    component=component,
                                    distroseries=distroseries(),
                                    person=self(),
                                    pocket=pocket,
                                    sourcepackagename=package,
                                    )
                        canUpload = True
                  except HTTPError, e:
                        if e.response.status == 403:
                              canUpload = False
                        else:
                              raise e
                  self._upload[(archive, distroseries, pocket, package, component)] = canUpload

            return canUpload


class Build(BaseWrapper):


Generated by  Doxygen 1.6.0   Back to index