Skip to content

Commit

Permalink
feat: upgrading mx_createwebservices to use the (more reliable) datas…
Browse files Browse the repository at this point in the history
…tep engine for work library export
  • Loading branch information
Allan Bowe committed Apr 12, 2020
1 parent 646fa1d commit 768507a
Show file tree
Hide file tree
Showing 6 changed files with 590 additions and 329 deletions.
22 changes: 13 additions & 9 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,37 @@
# prepare web files
files=['viya/mv_createwebservice.sas','meta/mm_createwebservice.sas']
for file in files:
webout0=open('base/mp_jsonout.sas','r')
if file=='viya/mv_createwebservice.sas':
webout=open('viya/mv_webout.sas',"r")
webout1=open('viya/mv_webout.sas',"r")
else:
webout=open('meta/mm_webout.sas','r')
webout1=open('meta/mm_webout.sas','r')
outfile=open(file + 'TEMP','w')
infile=open(file,'r')
delrow=0
for line in infile:
if line=='/* WEBOUT BEGIN */\n':
delrow=1
outfile.write('/* WEBOUT BEGIN */\n')
stripcomment=1
for w in webout:
if w=='**/\n': stripcomment=0
elif stripcomment==0:
outfile.write(" put '" + w.rstrip().replace("'","''") + " ';\n")
weboutfiles=[webout0,webout1]
for weboutfile in weboutfiles:
stripcomment=1
for w in weboutfile:
if w=='**/\n': stripcomment=0
elif stripcomment==0:
outfile.write(" put '" + w.rstrip().replace("'","''") + " ';\n")
elif delrow==1 and line=='/* WEBOUT END */\n':
delrow=0
outfile.write('/* WEBOUT END */\n')
elif delrow==0:
outfile.write(line.rstrip() + "\n")
webout.close()
webout0.close()
webout1.close()
outfile.close()
infile.close()
os.remove(file)
os.rename(file + 'TEMP',file)


# Concatenate all macros into a single file
header="""
/**
Expand All @@ -73,6 +76,7 @@
@author Allan Bowe
**/
options noquotelenmax;
"""
f = open('mc_all.sas', "w") # r / r+ / rb / rb+ / w / wb
f.write(header)
Expand Down

0 comments on commit 768507a

Please sign in to comment.