How to use the saspy.sascfg function in saspy

To help you get started, we’ve selected a few saspy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sassoftware / saspy / saspy / pysas34.py View on Github external
if len(self.configs) == 0:
            print("No SAS Configuration names found in saspy.sascfg")
            return None
         else:
            if len(self.configs) == 1:
               cfgname = self.configs[0]
               if Kernel == None:
                  print("Using SAS Config named: "+cfgname)
            else:
               cfgname = self._prompt("Please enter the name of the SAS Config you wish to run. Available Configs are: "+str(self.configs)+" ")

      while cfgname not in self.configs:
         cfgname = self._prompt("The SAS Config name specified was not found. Please enter the SAS Config you wish to use. Available Configs are: "+str(self.contexts)+" ")

      self.name       = cfgname
      cfg             = getattr(sascfg, cfgname) 
      if len(ip)      == 0:
         self.ip      = cfg.get('ip', '')
      if len(port)    == 0:
         self.port    = cfg.get('port', 80)
      if len(context) == 0:
         self.ctxname = cfg.get('context', '')
      if len(options) == 0:
         self.options = cfg.get('options', '')
      if len(user)    == 0:
         user         = cfg.get('user', '')
      if len(pw)      == 0:
         pw           = cfg.get('pw', '')

      while len(self.ip) == 0:
         self.ip = self._prompt("Please enter the host (ip address) you are trying to connect to: ")
github sassoftware / saspy / saspy / pysas34.py View on Github external
def __init__(self, cfgname='', Kernel=None, user='', pw='', ip='', port='', context='', options=''):
      #import pdb; pdb.set_trace()

      self.configs  = []
      self._kernel  = Kernel
      self.ip       = ip
      self.port     = port
      self.contexts = []
      self.ctxname  = context
      self.options  = options
      self._token   = None

      # GET Config
      self.configs = getattr(sascfg, "SAS_config_names")

      if len(cfgname) == 0:
         if len(self.configs) == 0:
            print("No SAS Configuration names found in saspy.sascfg")
            return None
         else:
            if len(self.configs) == 1:
               cfgname = self.configs[0]
               if Kernel == None:
                  print("Using SAS Config named: "+cfgname)
            else:
               cfgname = self._prompt("Please enter the name of the SAS Config you wish to run. Available Configs are: "+str(self.configs)+" ")

      while cfgname not in self.configs:
         cfgname = self._prompt("The SAS Config name specified was not found. Please enter the SAS Config you wish to use. Available Configs are: "+str(self.contexts)+" ")