1- # -*- coding: utf-8 -*-
2- from __future__ import absolute_import
31from ._utils import lib , codec , CheckForError , get_string , get_string_array
42
53
@@ -124,10 +122,12 @@ def LegacyModels(*args):
124122 or contact the authors from DSS Extensions: https://github.com/dss-extensions/
125123
126124 After toggling LegacyModels, run a "clear" command and the models will be loaded accordingly.
127- Defaults to False.
125+ Defaults to False.
128126
129127 This can also be enabled by setting the environment variable DSS_CAPI_LEGACY_MODELS to 1.
130128
129+ NOTE: this option will be removed in a future release.
130+
131131 (API Extension)
132132 """
133133 # Getter
@@ -136,7 +136,31 @@ def LegacyModels(*args):
136136
137137 # Setter
138138 Value , = args
139- return CheckForError (lib .DSS_Set_LegacyModels (Value ))
139+ CheckForError (lib .DSS_Set_LegacyModels (Value ))
140+
141+
142+ def AllowChangeDir (* args ):
143+ """
144+ If disabled, the engine will not change the active working directory during execution. E.g. a "compile"
145+ command will not "chdir" to the file path.
146+
147+ If you have issues with long paths, enabling this might help in some scenarios.
148+
149+ Defaults to True (allow changes, backwards compatible) in the 0.10.x versions of DSS C-API.
150+ This might change to False in future versions.
151+
152+ This can also be set through the environment variable DSS_CAPI_ALLOW_CHANGE_DIR. Set it to 0 to
153+ disallow changing the active working directory.
154+
155+ (API Extension)
156+ """
157+ # Getter
158+ if len (args ) == 0 :
159+ return CheckForError (lib .DSS_Get_AllowChangeDir ()) != 0
160+
161+ # Setter
162+ Value , = args
163+ CheckForError (lib .DSS_Set_AllowChangeDir (Value ))
140164
141165
142166_columns = [
@@ -167,4 +191,5 @@ def LegacyModels(*args):
167191 "NewCircuit" ,
168192 "AllowEditor" ,
169193 "LegacyModels" ,
194+ "AllowChangeDir" ,
170195]
0 commit comments