How to use the saspy.sascfg.__file__.replace 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 / autocfg.py View on Github external
def main(cfgfile: str = None, SASHome: str = None, java: str = None):

    if os.name != 'nt':
       print('This function will only run on Windows and create a saspy config file for an IOM Local connection')
       return
    
    saspydir = ac.__file__.replace('sascfg.py', '')
    
    if not cfgfile:
       cfgfile = saspydir+'sascfg_personal.py'

    # if the file already exists, don't replace it.
    if os.path.exists(cfgfile):
        print("CFGFILE ALREADY EXISTS: " + cfgfile)
        return

    # handles users who could have different versions
    if not SASHome:
       SASHome = "C:\\Program Files\\SASHome"

    if not java:
       java = 'java'