On 29.08.19 15:22, Vladimir Sementsov-Ogievskiy wrote:
> 28.08.2019 19:40, Max Reitz wrote:
>> On 26.08.19 18:13, Vladimir Sementsov-Ogievskiy wrote:

[...]

>>> +
>>> +    def get_bitmap(self, bitmaps, node_name, name, recording=None):
>>> +        """
>>> +        get a specific bitmap from the object returned by query_bitmaps.
>>> +        :param recording: If specified, filter results by the specified 
>>> value.
>>> +        """
>>> +        if bitmaps is None:
>>> +            bitmaps = self.query_bitmaps()
>>> +
>>> +        for bitmap in bitmaps['bitmaps'][node_name]:
>>> +            if bitmap.get('name', '') == name:
>>> +                if recording is None:
>>> +                    return bitmap
>>> +                elif bitmap.get('recording') == recording:
>>> +                    return bitmap
>>
>> Maybe add a “break” or “return None” here?
>>
>> (Yes, yes, you just moved existing code.  Still.)
>>
> 
> No, as we may have several unnamed bitmaps, which should be selected by 
> "recording"..

Ah.  OK.  Now it all makes sense...

Max

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to