601
601
return (PackageUploadCustomFormat.DDTP_TARBALL
602
602
in self._customFormats)
605
def package_name(self):
606
"""See `IPackageUpload`."""
607
if self.package_copy_job_id is not None:
608
return self.package_copy_job.package_name
609
elif self.sourcepackagerelease is not None:
610
return self.sourcepackagerelease.sourcepackagename.name
615
def package_version(self):
616
"""See `IPackageUpload`."""
617
if self.package_copy_job_id is not None:
618
return self.package_copy_job.metadata["package_version"]
619
elif self.sourcepackagerelease is not None:
620
return self.sourcepackagerelease.version
625
def component_name(self):
626
"""See `IPackageUpload`."""
627
if self.package_copy_job_id is not None:
628
return self.package_copy_job.metadata["component_override"]
629
elif self.sourcepackagerelease is not None:
630
return self.sourcepackagerelease.component.name
635
def section_name(self):
636
"""See `IPackageUpload`."""
637
if self.package_copy_job_id is not None:
638
return self.package_copy_job.metadata["section_override"]
639
elif self.sourcepackagerelease is not None:
640
return self.sourcepackagerelease.section.name
605
645
def displayname(self):
606
646
"""See `IPackageUpload`."""
608
for queue_source in self.sources:
609
names.append(queue_source.sourcepackagerelease.name)
648
if self.contains_source or self.package_copy_job_id is not None:
649
names.append(self.package_name)
610
650
for queue_build in self.builds:
611
651
names.append(queue_build.build.source_package_release.name)
612
652
for queue_custom in self.customfiles:
622
662
def displayarchs(self):
623
663
"""See `IPackageUpload`"""
625
for queue_source in self.sources:
665
if self.contains_source or self.package_copy_job_id is not None:
626
666
archs.append('source')
627
667
for queue_build in self.builds:
628
668
archs.append(queue_build.build.distro_arch_series.architecturetag)
634
674
def displayversion(self):
635
675
"""See `IPackageUpload`"""
637
return self.sources[0].sourcepackagerelease.version
639
return self.builds[0].build.source_package_release.version
676
package_version = self.package_version
677
if package_version is not None:
678
return package_version
679
elif self.customfiles:
644
685
def sourcepackagerelease(self):
645
"""The source package release related to this queue item.
647
This is currently heuristic but may be more easily calculated later.
650
return self.sources[0].sourcepackagerelease
652
return self.builds[0].build.source_package_release
657
def my_source_package_release(self):
658
"""The source package release related to this queue item.
660
al-maisan, Wed, 30 Sep 2009 17:58:31 +0200:
661
The cached property version above behaves very finicky in
662
tests and I've had a *hell* of a time revising these and
665
In any case, Celso's advice was to stay away from it
666
and I am hence introducing this non-cached variant for
667
usage inside the content class.
669
if self.sources is not None and bool(self.sources):
670
return self.sources[0].sourcepackagerelease
671
elif self.builds is not None and bool(self.builds):
686
"""See `IPackageUpload`."""
687
if self.contains_source:
688
return self.sources[0].sourcepackagerelease
689
elif self.contains_build:
672
690
return self.builds[0].build.source_package_release