Skip to content

Commit

Permalink
prototype reset api call in IOM access method (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomweber-sas authored Feb 7, 2025
1 parent 34fdea1 commit 8258447
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
Binary file modified saspy/java/pyiom/saspy2j.class
Binary file not shown.
5 changes: 5 additions & 0 deletions saspy/java/pyiom/saspy2j.java
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,11 @@ else if (eol.contains("ENDSAS"))
t1.join();
return;
}
else if (eol.contains("RESET"))
{
lang.Reset();
pgm = pgm.substring(idx + 13 + 33);
}
else if (eol.contains("PRINTTO"))
{
undo = true;
Expand Down
Binary file modified saspy/java/saspyiom.jar
Binary file not shown.
9 changes: 9 additions & 0 deletions saspy/sasbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,15 @@ def submit(self, code: str, results: str = '', prompt: dict = None, printto=Fals
:param GETstatusDelay: Number of seconds to sleep between HTTP calls to poll and see if the submitted code has finished
:param GETstatusFailcnt: Number of disconnect failures to ignore before failing, when polling to see if the submitted code has finished
**IOM**
This boolean kwargs is only available for the IOM Access Method. It's an API call to reset the LanguageServive to an initial state with respect
to token scanning Use it to extricate the LanguageService from an error state associated with the execution of invalid syntax or incomplete
program source. Note, this was requested by a user, but it's not something that would normally be needed. Also, the reset will happen prior
to submitting the code provided.
:param reset: resets the LanguageService to an initial state with respect to token scanning; default is False
:return: a Dict containing two keys:values, [LOG, LST]. LOG is text and LST is 'results' (HTML or TEXT)
Expand Down
4 changes: 4 additions & 0 deletions saspy/sasioiom.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ def submit(self, code: str, results: str ="html", prompt: dict = None, **kwargs)
HTML(results['LST'])
'''
prompt = prompt if prompt is not None else {}
reset = kwargs.pop('reset', False)
printto = kwargs.pop('undo', False)
cancel = kwargs.pop('cancel', False)
lines = kwargs.pop('loglines', False)
Expand Down Expand Up @@ -968,6 +969,9 @@ def submit(self, code: str, results: str ="html", prompt: dict = None, **kwargs)
if ods:
pgm += odsclose

if reset:
print('RESETTING')
self.stdin[0].send(b'\ntom says EOL=RESET \n')
if printto:
self.stdin[0].send(b'\ntom says EOL=PRINTTO \n')
if lines:
Expand Down

0 comments on commit 8258447

Please sign in to comment.