Don't add a border to any mapfile with a usage=mask header.

Also, warn if a file has usage=mask and a map extension or vice-versa.
This commit is contained in:
Eric S. Raymond 2007-11-07 14:12:30 +00:00
parent 9ab7a41997
commit 4d95ea11c5

View file

@ -1155,6 +1155,14 @@ def translator(filename, mapxforms, textxform):
add_border = False
if "usage" in line:
add_usage = False
usage = line.split("=")[1].strip()
if usage == 'mask':
add_border = False
if filename.endswith(".map"):
print "warning: usage=mask in file with .map extension"
elif usage == 'map':
if filename.endswith(".mask"):
print "warning: usage=map in file with .mask extension"
if len(line) == 0:
have_delimiter = True
newdata.append(line + terminator)