1 |
On Tue, 15 Mar 2016 14:03:41 -0700 |
2 |
Zac Medico <zmedico@g.o> wrote: |
3 |
|
4 |
> On 03/15/2016 01:57 PM, Brian Dolbec wrote: |
5 |
> > On Tue, 15 Mar 2016 13:31:24 -0700 |
6 |
> > Zac Medico <zmedico@g.o> wrote: |
7 |
> > |
8 |
> >>> |
9 |
> >>> Also, now that we are using Fuse, can't we stop returning things |
10 |
> >>> from these functions entirely, so that dynamic_data is only |
11 |
> >>> updated by side-effects? |
12 |
> >>> |
13 |
> >> |
14 |
> >> I think 'continue' is the only one left. We could just return a |
15 |
> >> single boolean, or use an exception to do what 'continue' does. |
16 |
> > |
17 |
> > NOPE :( not without a lot more work... |
18 |
> > |
19 |
> > arches.py: return {'continue': False, 'arches': arches} |
20 |
> > depend.py: return {'continue': False, 'unknown_pkgs': unknown_pkgs, |
21 |
> > 'type_list': type_list, 'badlicsyntax': badlicsyntax, |
22 |
> > 'baddepsyntax': baddepsyntax} |
23 |
> > ebuild.py: return {'continue': False, 'ebuild': self} |
24 |
> > return {'continue': False, 'pkg': self.pkg} |
25 |
> > isebuild.py: return {'continue': self.continue_, 'pkgs': pkgs, |
26 |
> > 'can_force': not self.continue_} |
27 |
> > live.py: return {'continue': False, |
28 |
> > 'live_ebuild': LIVE_ECLASSES.intersection( |
29 |
> > kwargs.get('ebuild').inherited)} |
30 |
> > fetches.py: return {'continue': False, 'src_uri_error': |
31 |
> > self._src_uri_error} |
32 |
> > pkgmetadata.py: return {'continue': False, 'muselist': |
33 |
> > frozenset(self.musedict)} |
34 |
> > return {'continue': False, 'muselist': |
35 |
> > frozenset(self.musedict)} |
36 |
> > scan.py: return {'continue': False, 'eadded': |
37 |
> > self.vcs_settings.status.eadded} |
38 |
> > use_flags.py: return {'continue': False, 'ebuild_UsedUseFlags': |
39 |
> > self.usedUseFlags, 'used_useflags': |
40 |
> > used_useflags} |
41 |
> > |
42 |
> > |
43 |
> > But we can define a generic dynamic_data class that holds the |
44 |
> > data that can be modified in a similar way to the Fuse class. That |
45 |
> > way we don't have to update it like we do a dictionary. |
46 |
> > |
47 |
> |
48 |
> Can't we add all these things to the dynamic_data dict that's |
49 |
> initialized in Scanner.scan_pkgs (along with Fuse instances), and just |
50 |
> let them get passed in as arguments, so that the functions can act on |
51 |
> them without having to return them? |
52 |
|
53 |
Yeah, /me is being a dummy. The modules are currently being passed |
54 |
the dict as a **kwargs. So the individual attributes are accessible |
55 |
directly. We could just pass it as one arg instead then the modules can |
56 |
just modify the dictionary directly since it is passed in by pointer. |
57 |
|
58 |
|
59 |
Sorry, my head is bouncing back and forth between this and other work |
60 |
code... But I like how we're getting the code in better shape... |
61 |
something I had reserved for stage3 ;) The current method is the first |
62 |
thing that came to me when I discovered I needed to get new data back |
63 |
into the dynamic_data for trailing modules in the queue. |
64 |
|
65 |
-- |
66 |
Brian Dolbec <dolsen> |