[chirp_devel] [PATCH 3 of 3] [ft8x7] React correctly on deletion of special memories

IZ3GME Marco
Thu Apr 19 08:53:50 PDT 2012


On 19/04/2012 17:18, Dan Smith wrote:
>> # HG changeset patch
>> # User Marco Filippi<iz3gme.marco at gmail.com>
>> # Date 1334846665 -7200
>> # Node ID 3caf35f8a005be15e9dfc339a9613579e15f02e2
>> # Parent  f7f98e5d8d1bd29bb0fcf42b8ed959a4ccab8b43
>> [ft8x7] React correctly on deletion of special memories
>
> This and the patch 2/3 needs a bug number :)

I'll file a bug later today and resend the two patches
I'll use same bug number as all is related to special memories behaviour

>
>>       def get_memory(self, number):
>>           if isinstance(number, str):
>>               return self._get_special(number)
>> +        elif number<  0:
>> +            # I can't stop delete operation from loosing extd_number but I know how to get it back
>
> Is this comment misplaced?

No, is in the right place: I had to add the elif code because on delete 
get_memory is called using negative index instead of extd_number as 
usual (and I don't even think to place my hands to UI)

>
>>       def _set_special(self, mem):
>> -        cur_mem = self._get_special(mem.extd_number)
>> +        if mem.empty:
>> +            # can't delete special memories!
>> +            return
>
> Can you throw an exception here like you do when the user tries to
> delete memory #1? I need to make the UI show that error to the user, and
> once I do, it would be good to have this one behave the same. Looks like
> this needs to be done for the other similar places as well.

Will give a try to the throw exception ...

>
>>       def get_memory(self, number):
>>           if number in self.SPECIAL_60M.keys():
>>               return self._get_special_60M(number)
>> +        elif number<  0 and self.SPECIAL_MEMORIES_REV[number] in self.SPECIAL_60M.keys():
>> +            # I can't stop delete operation from loosing extd_number but I know how to get it back
>
> Is this one misplaced also?

Same as other comment ... it's in correct place.

73 de IZ3GME Marco



More information about the chirp_devel mailing list