Skip to content

Commit c456e5b

Browse files
committed
Add feature for internal tester, and update version/changelog for new release
1 parent a951755 commit c456e5b

File tree

9 files changed

+53
-21
lines changed

9 files changed

+53
-21
lines changed

CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
# Changelog
22

33

4+
## [5.104.0] - 2025-10-30
5+
6+
### Added
7+
8+
- `Enhancement` A minor tweak to allow ODS output to be left 'asis' for internal testers here at SAS.
9+
Since SASPy started, the returned ODS Document from SAS has been tweakd to get it to render in Jupyter
10+
better than it looks by default. This new key in the `SAS_output_options` configuration option allows for this.
11+
12+
'asis' : False # defaults to how this has always worked
13+
14+
15+
### Changed
16+
17+
- `None` Nothing Changed
18+
19+
### Fixed
20+
21+
- `None` Nothing Changed
22+
23+
### Removed
24+
25+
- `None` Nothing removed
26+
27+
28+
429
## [5.103.2] - 2025-07-11
530

631
### Added
@@ -39,7 +64,7 @@ the http request calls that didn't have it, to handle unexpected failures better
3964

4065
### Fixed
4166

42-
- ` None` Nothing Fixed
67+
- `None` Nothing Fixed
4368

4469
### Removed
4570

@@ -67,7 +92,7 @@ as the code finishes.
6792

6893
### Fixed
6994

70-
- ` None` Nothing Fixed
95+
- `None` Nothing Fixed
7196

7297
### Removed
7398

saspy/doc/source/configuration.rst

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,15 @@ Here's an example showing these (I have one in the saspy install dir, current di
210210
211211
sascfg_personal.py details
212212
==========================
213-
There are three main parts to this configuration file.
213+
There are three main parts to this configuration file. Actually, there is a 4th non-required one too, which isn't needed normally.
214214

215215
1) SAS_config_names
216216
2) SAS_config_options # this dictionary isn't required unless you want to change a default
217-
3) Configuration definitions
217+
3) Configuration Definitions
218218

219-
In reverse order, the configuration definitions are Python dictionaries. Each dictionary
219+
4) SAS_output_options # this is available for adjusting some ODS settings. See it documented in the sascfg.py example file.
220+
221+
In reverse order, the Configuration Definitions are Python dictionaries. Each dictionary
220222
has the settings for one connection method (STDIO, SSH, IOM, and so on) to a SAS session.
221223
These values are defined in the following sections.
222224

@@ -256,13 +258,6 @@ For example, if you had SAS installed on your Linux system, your sascfg_personal
256258
257259
SAS_config_names = ['mycfg']
258260
259-
# this is actually optional, you only have to have it to change the defaults
260-
#SAS_config_options = {'lock_down': False,
261-
# 'verbose' : True,
262-
# 'prompt' : True,
263-
# 'style' : 'HTMLBlue'
264-
# }
265-
266261
mycfg = {'saspath' : '/opt/sasinside/SASHome/SASFoundation/9.4/bin/sas_u8'
267262
}
268263

saspy/sasbase.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ def __init__(self, **kwargs):
155155
try:
156156
outopts = getattr(SAScfg, "SAS_output_options")
157157
self.odsstyle = outopts.get('style', 'HTMLBlue')
158+
self.odsasis = outopts.get('asis', False)
158159
except:
159160
self.odsstyle = 'HTMLBlue'
161+
self.odsasis = False
160162

161163
# See if we don't want to allow prompting in this environment
162164
prompt = self.cfgopts.get('prompt', True)

saspy/sascfg.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,20 @@
5959
# properly with HTML 5.0 so it can also be set to HTML 4.0 instead (using "ods html" statement). This option will only work when using IOM
6060
# in local mode. Note that HTML 4.0 will generate images separately which clutters the workspace and if you download the notebook as HTML,
6161
# the HTML file will need to be put in the same folder as the images for them to appear.
62+
#
63+
# Note that this configuration option (SAS_output_options) is NOT required unless changing any of the defaultd
64+
#
6265
# valid keys are:
6366
#
6467
# 'output' = ['html5', 'html']
6568
# 'style' = any valid style # this will be the default for SASsession.HTML_Style, which you can also change dynamically in your code
69+
# 'asis' = True # don't tweak the html document (as has always been done) to get it to display better in Jupyter; leave it as is
6670
#
6771
#
68-
SAS_output_options = {'output' : 'html5', # not required unless changing any of the default
69-
'style' : 'HTMLBlue'}
72+
SAS_output_options = {'output' : 'html5', # change the ODS output destination; not suggested, only for special use case
73+
'style' : 'HTMLBlue', # defaults to SAS's default
74+
'asis' : False # defaults to how this has always worked
75+
}
7076

7177

7278
# Configuration Definitions

saspy/sasiocom.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ def submit(self, code: str, results: str='html', prompt: dict=None, **kwargs) ->
497497
except UnicodeDecodeError:
498498
lstf = lstf.decode(errors='replace')
499499

500-
listing = lstf \
500+
listing = lstf if self._sb.sascfg.odsasis else \
501+
lstf \
501502
.replace(chr(12), chr(10)) \
502503
.replace('<body class="c body">', '<body class="l body">') \
503504
.replace('font-size: x-small;', 'font-size: normal;')

saspy/sasiohttp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,8 @@ def _getlst(self, jobid=None):
10531053
i += 1
10541054
conn.close()
10551055

1056-
lstd = htm.replace(chr(12), chr(10)).replace('<body class="c body">',
1056+
lstd = htm if self._sb.sascfg.odsasis else \
1057+
htm.replace(chr(12), chr(10)).replace('<body class="c body">',
10571058
'<body class="l body">').replace("font-size: x-small;",
10581059
"font-size: normal;")
10591060
return lstd

saspy/sasioiom.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,9 +1081,10 @@ def submit(self, code: str, results: str ="html", prompt: dict = None, **kwargs)
10811081
if len(trip[1]) > 0 and len(trip[2]) < 200:
10821082
lstf = ''
10831083

1084-
lstd = lstf.replace(chr(12), chr(10)).replace('<body class="c body">',
1085-
'<body class="l body">').replace("font-size: x-small;",
1086-
"font-size: normal;")
1084+
lstd = lstf if self._sb.sascfg.odsasis else \
1085+
lstf.replace(chr(12), chr(10)).replace('<body class="c body">',
1086+
'<body class="l body">').replace("font-size: x-small;",
1087+
"font-size: normal;")
10871088
logf = logf.decode(errors='replace').replace(chr(12), chr(20))
10881089
self._log += logf
10891090
final = logf.partition(logcodei)

saspy/sasiostdio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,8 @@ def submit(self, code: str, results: str ="html", prompt: dict = None, **kwargs)
11111111
zz = z[0].rpartition("E3969440A681A24088859985" + prev)
11121112
logd = zz[2].replace(mj.decode(self.sascfg.encoding), '').replace(chr(12), chr(10))
11131113

1114-
lstd = lstf.replace(chr(12), chr(10)).replace('<body class="c body">',
1114+
lstd = lstf if self._sb.sascfg.odsasis else \
1115+
lstf.replace(chr(12), chr(10)).replace('<body class="c body">',
11151116
'<body class="l body">').replace("font-size: x-small;",
11161117
"font-size: normal;")
11171118
if self._checkLogForError(logd):

saspy/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '5.103.2'
1+
__version__ = '5.104.0'

0 commit comments

Comments
 (0)