On 03/15/2016 01:57 PM, Brian Dolbec wrote:
> On Tue, 15 Mar 2016 13:31:24 -0700
> Zac Medico <zmed...@gentoo.org> wrote:
> 
>>>
>>> Also, now that we are using Fuse, can't we stop returning things
>>> from these functions entirely, so that dynamic_data is only updated
>>> by side-effects?
>>>   
>>
>> I think 'continue' is the only one left. We could just return a single
>> boolean, or use an exception to do what 'continue' does.
> 
> NOPE :(  not without a lot more work...
> 
> arches.py: return {'continue': False, 'arches': arches}
> depend.py: return {'continue': False, 'unknown_pkgs': unknown_pkgs,
> 'type_list': type_list, 'badlicsyntax': badlicsyntax, 'baddepsyntax':
>                       baddepsyntax}
> ebuild.py: return {'continue': False, 'ebuild': self}
>            return {'continue': False, 'pkg': self.pkg}
> isebuild.py: return {'continue': self.continue_, 'pkgs': pkgs,
>                       'can_force': not self.continue_}
> live.py: return {'continue': False,
>                       'live_ebuild': LIVE_ECLASSES.intersection(
>                               kwargs.get('ebuild').inherited)}
> fetches.py: return {'continue': False, 'src_uri_error':
>                     self._src_uri_error}
> pkgmetadata.py: return {'continue': False, 'muselist':
>                         frozenset(self.musedict)}
>                 return {'continue': False, 'muselist':
>                         frozenset(self.musedict)}
> scan.py: return {'continue': False, 'eadded':
>                  self.vcs_settings.status.eadded}
> use_flags.py: return {'continue': False, 'ebuild_UsedUseFlags':
>                        self.usedUseFlags, 'used_useflags':
>                        used_useflags}
> 
> 
> But we can define a generic dynamic_data class that holds the
> data that can be modified in a similar way to the Fuse class.  That way
> we don't have to update it like we do a dictionary. 
> 

Can't we add all these things to the dynamic_data dict that's
initialized in Scanner.scan_pkgs (along with Fuse instances), and just
let them get passed in as arguments, so that the functions can act on
them without having to return them?
-- 
Thanks,
Zac

Reply via email to