Skip to content

Commit 6ea4552

Browse files
committed
Implements DSS.AllowEditor (enable/disable external editor calls)
Also renames DSSException from DssException, old name is kept for compatibility.
1 parent dcbe4bc commit 6ea4552

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
(not released)
44

55
- `CtrlQueue`: Add the missing function `Push`.
6+
- New `DSS.AllowEditor`: this new property controls if the external editor is called on DSS commands like `Show`. If set to `False`, the editor is not called, but other side effects should not be affected (e.g. files can be created).
67
- The `enum34` module was added as a dependency for Python < 3.5.
78
- The `Options` enumeration was split into several new enumerations (`AutoAddTypes`, `CktModels`, `ControlModes`, `SolutionLoadModels`, `SolutionAlgorithms`, `RandomModes`). It is now marked as deprecated for future removal.
89

dss/_cffi_api_util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ def use_com_compat(use=True, warn=False):
2525
del Base.__setattr__
2626
del Base.__getattr__
2727

28-
class DssException(Exception):
28+
class DSSException(Exception):
2929
pass
3030

31+
# For backwards compatibility
32+
DssException = DSSException
33+
3134
class Base(object):
3235
__slots__ = [
3336
'_lib',

dss/dss_capi_gr/IDSS.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@ def AllowForms(self, value):
126126
self._lib.DSS_Set_AllowForms(value)
127127
self.CheckForError()
128128

129+
@property
130+
def AllowEditor(self):
131+
'''Gets/sets whether running the external editor for "Show" is allowed
132+
133+
AllowEditor controls whether the external editor is used in commands like "Show".
134+
If you set to 0 (false), the editor is not executed. Note that other side effects,
135+
such as the creation of files, are not affected.
136+
'''
137+
return self._lib.DSS_Get_AllowEditor() != 0
138+
139+
@AllowEditor.setter
140+
def AllowEditor(self, value):
141+
self._lib.DSS_Set_AllowEditor(value)
142+
self.CheckForError()
143+
129144
def ShowPanel(self):
130145
warnings.warn('ShowPanel is not implemented.')
131146

dss/dss_capi_ir/IDSS.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@ def AllowForms(self, value):
126126
self._lib.DSS_Set_AllowForms(value)
127127
self.CheckForError()
128128

129+
@property
130+
def AllowEditor(self):
131+
'''Gets/sets whether running the external editor for "Show" is allowed
132+
133+
AllowEditor controls whether the external editor is used in commands like "Show".
134+
If you set to 0 (false), the editor is not executed. Note that other side effects,
135+
such as the creation of files, are not affected.
136+
'''
137+
return self._lib.DSS_Get_AllowEditor() != 0
138+
139+
@AllowEditor.setter
140+
def AllowEditor(self, value):
141+
self._lib.DSS_Set_AllowEditor(value)
142+
self.CheckForError()
143+
129144
def ShowPanel(self):
130145
warnings.warn('ShowPanel is not implemented.')
131146

0 commit comments

Comments
 (0)