> +it as a method will add jobs to calculate the heat of for all the bugs
> +whose heat is more than seven days old.
I think one of ('of', 'for') is sufficient ;)
> +
> +Before update_bug_heat is called, we'll ensure that there are no waiting
> +jobs in the bug heat calculation queue.
> +
> + >>> from lp.bugs.interfaces.bugjob import ICalculateBugHeatJobSource
> + >>> for calc_job in
getUtility(ICalculateBugHeatJobSource).iterReady():
> + ... calc_job.job.start()
> + ... calc_job.job.complete()
> +
> + >>> ready_jobs =
list(getUtility(ICalculateBugHeatJobSource).iterReady())
> + >>> len(ready_jobs)
> + 0
> +
> +We need to commit here to ensure that the bugs we've created are
> +available to the update_bug_heat script.
> +
> + >>> import transaction
> + >>> transaction.commit()
> +
> + >>> getUtility(IBugSet).getBugsWithOutdatedHeat(1).count()
> + 2
> +
> +We need to run update_bug_heat() twice to ensure that both the bugs are
> +updated.
I think you call update_bug_heat() in this doc test only once. But it
seems it should be called with chunksize=2 to ensure both bugs are
processed.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Graham,
nice banch! I have just two nitpicks, see below.
Abel
> === modified file 'lib/lp/ bugs/doc/ bug-heat. txt' bugs/doc/ bug-heat. txt 2010-03-03 13:10:17 +0000 bugs/doc/ bug-heat. txt 2010-03-05 10:13:32 +0000
> --- lib/lp/
> +++ lib/lp/
[...]
> +it as a method will add jobs to calculate the heat of for all the bugs
> +whose heat is more than seven days old.
I think one of ('of', 'for') is sufficient ;)
> + interfaces. bugjob import ICalculateBugHe atJobSource ICalculateBugHe atJobSource) .iterReady( ): job.start( ) job.complete( ) (ICalculateBugH eatJobSource) .iterReady( )) commit( ) IBugSet) .getBugsWithOut datedHeat( 1).count( )
> +Before update_bug_heat is called, we'll ensure that there are no waiting
> +jobs in the bug heat calculation queue.
> +
> + >>> from lp.bugs.
> + >>> for calc_job in
getUtility(
> + ... calc_job.
> + ... calc_job.
> +
> + >>> ready_jobs =
list(getUtility
> + >>> len(ready_jobs)
> + 0
> +
> +We need to commit here to ensure that the bugs we've created are
> +available to the update_bug_heat script.
> +
> + >>> import transaction
> + >>> transaction.
> +
> + >>> getUtility(
> + 2
> +
> +We need to run update_bug_heat() twice to ensure that both the bugs are
> +updated.
I think you call update_bug_heat() in this doc test only once. But it
seems it should be called with chunksize=2 to ensure both bugs are
processed.
> + bug_heat( chunk_size= 2) tJobs for 2 Bugs (starting id: ...)
> + >>> update_
> + DEBUG Adding CalculateBugHea
> + DEBUG Adding CalculateBugHeatJob for bug ...
> + DEBUG Adding CalculateBugHeatJob for bug ...
-----BEGIN PGP SIGNATURE----- enigmail. mozdev. org
Phm8NrtARApukAJ oCrVwFFnMkn4bR+ JHA6lbUGQaZigCg kHXF qmb/8X7o=
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iD8DBQFLkODxekB
ARR5bSLClYT7Elx
=+2Ba
-----END PGP SIGNATURE-----