This commit is contained in:
Tim Rühsen 2016-01-04 22:15:43 +01:00
parent f86094972a
commit 1bd9347af9
1 changed files with 4 additions and 4 deletions

View File

@ -501,7 +501,7 @@ def parse_psl(infile):
line = line[1:] line = line[1:]
elif line[0] == '*': elif line[0] == '*':
if line[1] != '.': if line[1] != '.':
print('Unsupported kind of rule (ignored): %s', line) print('Unsupported kind of rule (ignored): %s' % line)
continue continue
flags = PSL_FLAG_WILDCARD | PSL_FLAG_PLAIN | section flags = PSL_FLAG_WILDCARD | PSL_FLAG_PLAIN | section
line = line[2:] line = line[2:]
@ -536,7 +536,7 @@ def parse_psl(infile):
def usage(): def usage():
"""Prints the usage""" """Prints the usage"""
print('usage: %s [options] infile outfile', sys.argv[0]) print('usage: %s [options] infile outfile' % sys.argv[0])
print(' --input-format=psl2c infile has been generated by libpsl/psl2c utility (default)') print(' --input-format=psl2c infile has been generated by libpsl/psl2c utility (default)')
print(' --input-format=psl infile is a Public Suffix List file') print(' --input-format=psl infile is a Public Suffix List file')
print(' --output-format=cxx Write DAFSA as C/C++ code') print(' --output-format=cxx Write DAFSA as C/C++ code')
@ -560,7 +560,7 @@ def main():
elif value == 'psl2c': elif value == 'psl2c':
parser = parse_psl2c parser = parse_psl2c
else: else:
print("Unknown input format '%s'", value) print("Unknown input format '%s'" % value)
return 1 return 1
elif arg.startswith('--output-format='): elif arg.startswith('--output-format='):
value = arg[16:].lower() value = arg[16:].lower()
@ -569,7 +569,7 @@ def main():
elif value == 'cxx': elif value == 'cxx':
converter = words_to_cxx converter = words_to_cxx
else: else:
print("Unknown output format '%s'", value) print("Unknown output format '%s'" % value)
return 1 return 1
else: else:
usage() usage()