launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #23204
Re: [Merge] lp:~cjwatson/launchpad/refactor-ttb-composeBuildRequest into lp:launchpad
Review: Approve code
Diff comments:
>
> === modified file 'lib/lp/translations/model/translationtemplatesbuildbehaviour.py'
> --- lib/lp/translations/model/translationtemplatesbuildbehaviour.py 2017-11-08 10:57:11 +0000
> +++ lib/lp/translations/model/translationtemplatesbuildbehaviour.py 2019-01-07 14:29:14 +0000
> @@ -52,19 +54,22 @@
> self.unsafe_chars, '_', self.build.branch.unique_name)
> return "translationtemplates_%s_%d.txt" % (safe_name, self.build.id)
>
> - def composeBuildRequest(self, logger):
> - das = self._getDistroArchSeries()
> - args = {
> - 'arch_tag': das.architecturetag,
> - 'branch_url': self.build.branch.composePublicURL(),
> - 'series': das.distroseries.name,
> - }
> - return ("translation-templates", self._getDistroArchSeries(), {}, args)
> + @property
> + def archive(self):
> + ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
> + return ubuntu.main_archive
You could get this from self.distro_arch_series.main_archive rather than hardcoding the celeb in two places.
>
> - def _getDistroArchSeries(self):
> + @property
> + def distro_arch_series(self):
> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
> return ubuntu.currentseries.nominatedarchindep
>
> + def extraBuildArgs(self, logger=None):
> + args = super(TranslationTemplatesBuildBehaviour, self).extraBuildArgs(
> + logger=logger)
> + args["branch_url"] = self.build.branch.composePublicURL()
> + return args
> +
> def _readTarball(self, buildqueue, filemap, logger):
> """Read tarball with generated translation templates from slave."""
> if filemap is None:
--
https://code.launchpad.net/~cjwatson/launchpad/refactor-ttb-composeBuildRequest/+merge/361442
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
References