Skip to content

Commit

Permalink
Handle invalid build names
Browse files Browse the repository at this point in the history
  • Loading branch information
Dataliberate committed Sep 11, 2020
1 parent 818e6c2 commit 1743459
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
21 changes: 11 additions & 10 deletions util/buildfiles.py
Expand Up @@ -340,15 +340,16 @@ def buildFiles(files):

for p in files:
print("%s:"%p)
func, filenames = FILELIST.get(p,None)
if func:
content = func(p)
if content:
for filename in filenames:
fn = fileName(filename)
f = open(fn,"w")
f.write(content)
f.close()
print("Created %s" % fn)
if p in FILELIST.keys():
func, filenames = FILELIST.get(p,None)
if func:
content = func(p)
if content:
for filename in filenames:
fn = fileName(filename)
f = open(fn,"w")
f.write(content)
f.close()
print("Created %s" % fn)
else:
print("Unknown files name: %s" % p)
19 changes: 10 additions & 9 deletions util/buildocspages.py
Expand Up @@ -245,14 +245,15 @@ def buildDocs(pages):

for p in pages:
print("%s:"%p)
func, filenames = PAGELIST.get(p,None)
if func:
content = func(p)
for filename in filenames:
fn = fileName(filename)
f = open(fn,"w")
f.write(content)
f.close()
print("Created %s" % fn)
if p in PAGELIST.keys():
func, filenames = PAGELIST.get(p,None)
if func:
content = func(p)
for filename in filenames:
fn = fileName(filename)
f = open(fn,"w")
f.write(content)
f.close()
print("Created %s" % fn)
else:
print("Unknown page name: %s" % p)
3 changes: 3 additions & 0 deletions util/buildtermpages.py
Expand Up @@ -61,6 +61,9 @@ def buildTerms(terms):
for t in terms:
tic = datetime.datetime.now() #diagnostics
term = SdoTermSource.getTerm(t,expanded=True)
if not term:
print("No such term: %s\n" % t)
continue

if term.termType == SdoTerm.REFERENCE: #Don't create pages for reference types
continue
Expand Down

0 comments on commit 1743459

Please sign in to comment.