[Dextrose] [PATCH 3/5][dextrose2][sugar] Updater show failed updates number

Martin Abente martin.abente.lahaye at gmail.com
Fri Apr 22 11:35:36 EDT 2011


Any suggestion?

Could something like this work better?

"X updates were installed (Y failed)" //without showing the Y message
with Y <= 0

On Wed, Apr 20, 2011 at 3:08 AM, Sascha Silbe <silbe at activitycentral.com> wrote:
> Excerpts from Martin Abente's message of Tue Apr 19 23:21:26 +0200 2011:
>
> [extensions/cpsection/updater/view.py]
>> @@ -175,11 +176,20 @@ class ActivityUpdater(SectionView):
> [...]
>> -    def _finished_updating(self, installed_updates):
>> +    def _finished_updating(self, installed_updates, failed_updates):
>>          logging.debug('ActivityUpdater._finished_updating')
>> +        success_updates =  installed_updates - failed_updates
>>          top_message = ngettext('%s update was installed',
>> -                               '%s updates were installed', installed_updates)
>> -        top_message = top_message % installed_updates
>> +                               '%s updates were installed', success_updates)
>> +        top_message = top_message % success_updates
>> +
>> +        if failed_updates > 0:
>> +            failed_message = ngettext(' and %s update failed',
>> +                                      ' and %s updates failed',
>> +                                      failed_updates)
>> +            failed_message = failed_message % failed_updates
>> +            top_message += failed_message
>> +
>
> I'm not sure composing the message this way works for all languages.
> CC'ing Chris Leonard for advise.
>
> Sascha
>
> --
> http://sascha.silbe.org/
> http://www.infra-silbe.de/
>


More information about the Dextrose mailing list