File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 35
35
ANSYS_DPF_SERVER_CONTEXT=ENTRY and ANSYS_DPF_SERVER_CONTEXT=PREMIUM can be used.
36
36
"""
37
37
38
+ from __future__ import annotations
39
+
38
40
from enum import Enum
39
41
import os
40
42
import warnings
@@ -264,6 +266,29 @@ def xml_path(self):
264
266
"""
265
267
return self ._xml_path
266
268
269
+ @xml_path .setter
270
+ def xml_path (self , xml_path : str | os .PathLike ):
271
+ r"""Set the path to the xml file defining default plugins to load at server start.
272
+
273
+ Parameters
274
+ ----------
275
+ xml_path:
276
+ Path to the XML file to use at server start. Useful to target a custom XML file.
277
+
278
+ Examples
279
+ --------
280
+ Create a ServerContext targeting a custom XML file.
281
+
282
+ >>> import ansys.dpf.core as dpf
283
+ >>> # Create a custom server context
284
+ >>> custom_server_context = dpf.AvailableServerContexts.custom_defined
285
+ >>> # Set the XML path
286
+ >>> custom_server_context.xml_path = r'\path\to\file'
287
+ >>> # Start a DPF server using this context
288
+ >>> # server = dpf.start_local_server(context=custom_server_context)
289
+ """
290
+ self ._xml_path = str (xml_path )
291
+
267
292
def __str__ (self ):
268
293
"""Return string representation of the ServerContext instance."""
269
294
return (
You can’t perform that action at this time.
0 commit comments