@@ -102,7 +102,7 @@ def __init__(self, driver=None):
102102 driver = LocalDriver ()
103103 self .driver = driver
104104
105- self ._inits = {}
105+ self ._preparers = {}
106106
107107 def __reduce__ (self ):
108108 return rebuild , (self .driver ,)
@@ -111,33 +111,33 @@ def _key_of(self, *parts):
111111 """Get the key for a shared item"""
112112 return ":" .join (parts )
113113
114- def register_inits_list (self , component , inits ):
115- """Register a new list to pick initializers from"""
114+ def register_preparers_list (self , component , inits ):
115+ """Register a new list to pick preparers from"""
116116 # Ignore the request if a list was already registered
117- if component in self ._inits :
117+ if component in self ._preparers :
118118 return
119119
120- self ._inits [component ] = inits
120+ self ._preparers [component ] = inits
121121
122122 def of (self , bot , component ):
123123 """Get the shared memory of a specific component"""
124124 memory , is_new = self .driver .get (self ._key_of (bot , component ))
125125
126126 # Be sure to initialize the shared memory if it's needed
127127 if is_new :
128- self .apply_inits (component , memory )
128+ self .apply_preparers (component , memory )
129129
130130 # Add the lock method to the object
131131 memory .lock = functools .partial (self .lock , bot , component )
132132 return memory
133133
134- def apply_inits (self , component , memory ):
135- """Apply all the inits of a component to a memory"""
136- if component not in self ._inits :
134+ def apply_preparers (self , component , memory ):
135+ """Apply all the preparers of a component to a memory"""
136+ if component not in self ._preparers :
137137 return
138138
139- for init in self ._inits [component ]:
140- init .call (memory )
139+ for preparer in self ._preparers [component ]:
140+ preparer .call (memory )
141141
142142 def switch_driver (self , driver = None ):
143143 """Use another driver for this shared memory"""
0 commit comments