Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try:
_mva = getattr(_mva, name)
except Exception as e:
print(e)
break
if isinstance(_mva, SASsession):
mva = _mva
else:
return 'Invalid SAS Session object supplied'
elif len(line) and not line in self.shell.user_ns: # string supplied but not a session
return 'Invalid SAS Session object supplied'
else: # no string should default to unnamed session
try:
if mva is None:
mva = SASsession()
self.mva = mva # save the session for reuse
else:
mva = self.mva
except:
return "this shouldn't happen"
saveOpts="proc optsave out=__jupyterSASKernel__; run;"
restoreOpts="proc optload data=__jupyterSASKernel__; run;"
if len(line)>0: # Save current SAS Options
mva.submit(saveOpts)
if line.lower()=='smalllog':
mva.submit("options nosource nonotes;")
elif line is not None and line.startswith('option'):
mva.submit(line + ';')
def __init__(self, shell):
super(SASMagic, self).__init__(shell)
self.lst_len = -99 # initialize the length to a negative number to trigger function
self.mva = None
if self.lst_len < 0 and isinstance(self.mva, SASsession) :
self._get_lst_len()