Browse Source

Catch missing xml2yml.ysl2 early.

some-fixes
Hartmut Goebel 5 years ago
parent
commit
c641c0500d
1 changed files with 8 additions and 9 deletions
  1. +8
    -9
      yml2proc

+ 8
- 9
yml2proc View File

@ -94,16 +94,15 @@ backend.includePath.extend(dirs)
if options.xml2yml:
for directory in backend.includePath:
try:
name = directory + "/xml2yml.ysl2"
f = open(name, "r")
f.close()
name = os.path.join(directory, "xml2yml.ysl2")
if os.path.isfile(name):
options.yslt = name
options.xml = True
break
except:
pass
options.yslt = name
options.xml = True
else:
sys.stderr.write("Error: Stylesheet xml2yml.ysl2 required for --xml2yml not found\n")
sys.stderr.write("Please check your YML_PATH\n")
sys.exit(1)
if (options.xslt and options.yslt) or (options.xslt and options.xpath) or (options.yslt and options.xpath):
sys.stderr.write("Cannot combine --xpath, --xslt and --yslt params\n")


Loading…
Cancel
Save