@@ -178,18 +178,26 @@ def dump(self) -> None:
178
178
"opensearchpy/_async/client/plugins.py" , "r+" , encoding = "utf-8"
179
179
) as file :
180
180
content = file .read ()
181
- file_content = content .replace (
182
- "super(PluginsClient, self ).__init__(client)" ,
183
- f"super(PluginsClient, self ).__init__(client)\n self.{ self .namespace } = { self .namespace_new } Client(client)" , # pylint: disable=line-too-long
181
+ content = content .replace (
182
+ "super().__init__(client)\n " ,
183
+ f"super().__init__(client)\n \n self.{ self .namespace } = { self .namespace_new } Client(client)" , # pylint: disable=line-too-long
184
184
1 ,
185
185
)
186
- new_file_content = file_content .replace (
186
+ content = content .replace (
187
187
"from .client import Client" ,
188
188
f"from ..plugins.{ self .namespace } import { self .namespace_new } Client\n from .client import Client" , # pylint: disable=line-too-long
189
189
1 ,
190
190
)
191
+ content = content .replace (
192
+ "class PluginsClient(NamespacedClient):\n " ,
193
+ f"class PluginsClient(NamespacedClient): \n { self .namespace } : Any\n " , # pylint: disable=line-too-long
194
+ 1 ,
195
+ )
196
+ content = content .replace (
197
+ "plugins = [" , f'plugins = [\n "{ self .namespace } ",\n '
198
+ )
191
199
file .seek (0 )
192
- file .write (new_file_content )
200
+ file .write (content )
193
201
file .truncate ()
194
202
195
203
else :
0 commit comments