[PATCH 2/2] retag: Properly display the final count
Damien Lespiau
damien.lespiau at intel.com
Mon Nov 9 21:51:13 AEDT 2015
On Mon, Nov 09, 2015 at 02:37:54AM +0000, Finucane, Stephen wrote:
> > i == count cannot happen in the loop as i will vary from 0 to count - 1.
> >
> > Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
> > ---
> > patchwork/management/commands/retag.py | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/patchwork/management/commands/retag.py
> > b/patchwork/management/commands/retag.py
> > index e67d099..cb95398 100644
> > --- a/patchwork/management/commands/retag.py
> > +++ b/patchwork/management/commands/retag.py
> > @@ -38,7 +38,8 @@ class Command(BaseCommand):
> >
> > for i, patch in enumerate(query.iterator()):
> > patch.refresh_tag_counts()
> > - if (i % 10) == 0 or i == count:
> > + if (i % 10) == 0:
>
> What happens if count == 11?
I don't where you are going with this question. In the loop we'll print
something out when i is 0, then 10. Out of the loop we'll print out
11/11. But that cannot be what you were asking, am I missing a question
behind the question?
--
Damien
>
> > sys.stdout.write('%06d/%06d\r' % (i, count))
> > sys.stdout.flush()
> > + sys.stdout.write('%06d/%06d\r' % (count, count))
> > sys.stdout.write('\ndone\n')
> > --
> > 2.4.3
> >
> > _______________________________________________
> > Patchwork mailing list
> > Patchwork at lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/patchwork
More information about the Patchwork
mailing list