@@ -5,44 +5,36 @@ import sys
55
66from cython.operator cimport dereference
77
8- from ..cpp.callable cimport callable , registered, registry_entry
9- from ..cpp.registry cimport registered, registry_entry
10- from ..cpp.config cimport load
11-
128from ..config cimport translate_exception
139from .callable cimport wrap
1410from .array cimport _registry_assign_init as assign_init
1511
1612assign_init()
1713
18- from libcpp.map cimport map
19- from libcpp.pair cimport pair
20- from libcpp.string cimport string
21-
2214from cython.operator import preincrement
2315
24- cdef void add_one (registry_entry * parent_entry, const char * name, registry_entry * entry) with gil:
16+ cdef void update (registry_entry * parent_entry, const char * name, registry_entry * entry) with gil:
2517 if (entry.is_namespace()):
2618 try :
2719 new_mod = sys.modules[entry.path()]
2820 except KeyError :
2921 new_mod = imp.new_module(entry.path())
3022 sys.modules[entry.path()] = new_mod
31- _publish_callables(dereference( entry) )
23+ propagate( entry)
3224 if (not parent_entry.path().empty()):
3325 mod = sys.modules[parent_entry.path()]
3426 setattr (mod, name, new_mod)
3527 else :
3628 mod = sys.modules[parent_entry.path()]
3729 setattr (mod, name, wrap(entry.value()))
3830
39- cdef _publish_callables (registry_entry & entry):
40- entry.observe(& add_one )
31+ cdef void propagate (registry_entry * entry):
32+ entry.observe(update )
4133
4234 cdef map [string, registry_entry].iterator it = entry.begin()
4335 while (it != entry.end()):
44- add_one( & entry, dereference(it).first.c_str(), & dereference(it).second)
36+ update( entry, dereference(it).first.c_str(), & dereference(it).second)
4537 preincrement(it)
4638
47- def publish_callables ():
48- return _publish_callables( registered())
39+ def propagate_all ():
40+ return propagate( & registered())
0 commit comments