-
Notifications
You must be signed in to change notification settings - Fork 2
/
__init__.py
35 lines (30 loc) · 1.07 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# __init__.py for pysas
#
#
from . import sastask
from . import parser
from . import param
from . import error
from . import runtask
from . import configutils
from . import init_sas
from . import sasutils
from .version import *
from .odfcontrol import odfcontrol
__version__ = f'pysas - (pysas-{VERSION}) [{SAS_RELEASE}-{SAS_AKA}]'
## For initialization of pySAS from configuration file.
from .configutils import sas_cfg
from .init_sas import initializesas
import os
sas_dir = sas_cfg.get("sas", "sas_dir")
sas_ccfpath = sas_cfg.get("sas", "sas_ccfpath")
# Checks if defaults work.
if sas_cfg['DEFAULT']['on_sci_server'] == 'False':
if os.path.exists(sas_dir) and os.path.exists(sas_ccfpath):
initializesas(sas_dir, sas_ccfpath)
elif sas_dir != '/does/not/exist' and sas_ccfpath != '/does/not/exist':
print('There is a problem with either SAS_DIR or SAS_CCFPATH in the config file.')
print('Please set manually to initialize SAS.')
print('sas_dir....: {}'.format(sas_dir))
print('sas_ccfpath: {}'.format(sas_ccfpath))
del sas_dir, sas_ccfpath