1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA1 |
3 |
|
4 |
>>>+from portage.util.currying import pre_curry, pretty_docs |
5 |
>>>+ |
6 |
>>>+def proxy_it(method, *a, **kw): |
7 |
>>>+ global registry |
8 |
>>>+ if registry == None: |
9 |
>>>+ registry = GlobalPluginRegistry() |
10 |
>>>+ return getattr(registry, method)(*a, **kw) |
11 |
>>>+ |
12 |
>>>+for x in ["register", "deregister", "query_plugins", "get_plugin"]: |
13 |
>>>+ v = pre_curry(proxy_it, x) |
14 |
>>>+ doc = getattr(GlobalPluginRegistry, x).__doc__ |
15 |
>>>+ if doc == None: |
16 |
>>>+ doc = '' |
17 |
>>>+ else: |
18 |
>>>+ # do this so indentation on pydoc __doc__ is sane |
19 |
>>>+ doc = "\n".join(map(lambda x:x.lstrip(), doc.split("\n"))) +"\n" |
20 |
>>>+ doc += "proxied call to module level registry instances %s method" % x |
21 |
>>>+ globals()[x] = pretty_docs(v, doc) |
22 |
>>>+ |
23 |
>>>+del x, v, proxy_it, doc |
24 |
>>> |
25 |
>>>What's this currying and pretty_docs stuff? |
26 |
>> |
27 |
>>currying == arg binding to a func- in this case, proxy_it gets first |
28 |
>>arg of the attr requested; the proxy_it func instantiates a |
29 |
>>GlobalPluginRegistry instance if it's missing. |
30 |
> |
31 |
> |
32 |
> This stuff seems to be missing from the patch then. |
33 |
> |
34 |
> -- |
35 |
> Jason Stubbs |
36 |
> |
37 |
|
38 |
Yep that would be my fault ;) |
39 |
|
40 |
- -Alec Warner (antarus) |
41 |
|
42 |
PS: apparently I suck at generating patches, will try again later. |
43 |
-----BEGIN PGP SIGNATURE----- |
44 |
Version: GnuPG v1.4.1 (GNU/Linux) |
45 |
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org |
46 |
|
47 |
iQIVAwUBQ36+A2zglR5RwbyYAQKaaQ/+O9AKA4yu3SzJRZslZarX8gIOecPUZhQu |
48 |
RPX3VUQYL5laXhzxtLFMeqUVgQJuv2P6/kqXoG34uqjL22F2KbNoyZT1MEl5IYZF |
49 |
pW1QnTQTEEddR47nQfeRSDXQRAU3qqlYoEMFjJb+x5SmvY7HsjhNQMJMqBmuhggZ |
50 |
xeSl9PvGaQGleoqzGtMrwIo+tHAMWGJki+KXxwoF4NA0E/k/GyIvl4gsp0cobfgE |
51 |
yk4XNyp2g+mU+vCzl5gmtLPQLTRpI/VNL6cX6VqI0xdbOejIZdD0AU/tIsJJ1JLi |
52 |
VdOMOwouExqvDvty7OjzOILAFBmlwYj62k5Ln/RKFx9ssAy3mq7SsSyATOMMVgnC |
53 |
CmA3TfBCsHZeSzEUqI/W+OGMWfxgIQ/dgfq+VXDV5z4A8DEjLcvTzkL3mL2FXOTk |
54 |
NeOzMp28Vh6OjxRauELJpSZH1y3OfoocRagPo1m++jFyZHoBRtOxJaDj/pS6ceFY |
55 |
p3Xatiu4HHjoB1sV4bkTYGuictn1Xi/M6wSvh2f6ACV+2QqYyaHp831cp4iLdTeM |
56 |
0vg3EIYGK3JZ/OIVhqMjgCw5uNO7QtCKICgRrk3xz7Cg9hjLskKgXhU4QPSUAXtr |
57 |
TtxaxEK1tsHAQ5zdSSa4tokFoxANBfvDClnl6L/r6EoSe5GGy5DDiTUKkNSDEV/6 |
58 |
E+3jeM+E4W8= |
59 |
=c3Hm |
60 |
-----END PGP SIGNATURE----- |
61 |
-- |
62 |
gentoo-portage-dev@g.o mailing list |