aboutsummaryrefslogtreecommitdiff
path: root/python/bro.py
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas@google.com>2017-08-04 10:02:56 +0200
committerGitHub <noreply@github.com>2017-08-04 10:02:56 +0200
commitd63e8f75f5c16a6d7c8308bfd28c43cbdb6ad390 (patch)
tree9fd22d0e842c81ed36c561107c6f3196fd915855 /python/bro.py
parent06082531107d666ba44bb4dc341970a0916ef587 (diff)
downloadbrotli-d63e8f75f5c16a6d7c8308bfd28c43cbdb6ad390.zip
brotli-d63e8f75f5c16a6d7c8308bfd28c43cbdb6ad390.tar.gz
brotli-d63e8f75f5c16a6d7c8308bfd28c43cbdb6ad390.tar.bz2
Update API, and more (#581)
Update API, and more: * remove "custom dictionary" support * c/encoder: fix #580: big-endian build * Java: reduce jar size * Java: speedup decoding * Java: add 32-bit CPU support * Java: make source code JS transpiler-ready
Diffstat (limited to 'python/bro.py')
-rwxr-xr-xpython/bro.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/python/bro.py b/python/bro.py
index 2a84e42..7a094b4 100755
--- a/python/bro.py
+++ b/python/bro.py
@@ -114,13 +114,6 @@ def main(args=None):
help='Base 2 logarithm of the maximum input block size. '
'Range is 16 to 24. If set to 0, the value will be set based '
'on the quality. Defaults to 0.')
- params.add_argument(
- '--custom-dictionary',
- metavar='FILE',
- type=str,
- dest='dictfile',
- help='Custom dictionary file.',
- default=None)
# set default values using global DEFAULT_PARAMS dictionary
parser.set_defaults(**DEFAULT_PARAMS)
@@ -145,25 +138,16 @@ def main(args=None):
else:
outfile = get_binary_stdio('stdout')
- if options.dictfile:
- if not os.path.isfile(options.dictfile):
- parser.error('file "%s" not found' % options.dictfile)
- with open(options.dictfile, 'rb') as dictfile:
- custom_dictionary = dictfile.read()
- else:
- custom_dictionary = ''
-
try:
if options.decompress:
- data = brotli.decompress(data, dictionary=custom_dictionary)
+ data = brotli.decompress(data)
else:
data = brotli.compress(
data,
mode=options.mode,
quality=options.quality,
lgwin=options.lgwin,
- lgblock=options.lgblock,
- dictionary=custom_dictionary)
+ lgblock=options.lgblock)
except brotli.error as e:
parser.exit(1,
'bro: error: %s: %s' % (e, options.infile or 'sys.stdin'))