Commit Graph

92 Commits

Author SHA1 Message Date
Alex Nicksay
6ab0a5cee7 Python: Create Makefile for development shortcuts (#488) 2016-12-21 10:17:11 +01:00
Eugene Kliuchnikov
fd96151b2a Move brotlidump.py to research/ (#487) 2016-12-20 18:00:51 +01:00
jneb
f62cd2bcd2 brotlidump.py: disassemble brotli file (revisited) (#314)
* Create brotlidump.py

Sorry, I am a newbie. I couldn't find my file anymore when I wanted to edit it. Hope I don't waste your time.

* Fixed a bug where it couldn't read its own compression.

The problem was that a prefix code ending with a 16 "repeat" didn't realize the table was full already.
Also minor bug fixes, comments and stuff.

* Major refactoring

Rewrote almost everything.
Now can dump its own compression.

* Now more or less complete

Appears to handle all files completely (including metablock data).
Used as inspiration for the the hex example (see makehexexample.py)
2016-12-20 14:41:47 +01:00
Alex Nicksay
89a5b6e625 Python: Simplify test suite generation by using unittest discovery (#485) 2016-12-20 14:40:47 +01:00
Alex Nicksay
6f227228ce Python: Use a temporary directory for generated files in tests (#481) 2016-12-12 10:28:44 +01:00
Alex Nicksay
4651f7c000 Python: Format bro.py with yapf (#480) 2016-12-12 10:28:15 +01:00
Eugene Kliuchnikov
0ee416139f Update python brotli wrapper (#479)
* Update python brotli wrapper
 * release GIL on CPU intensive blocks, fixes #476
 * use BrotliDecoderTakeOutput (less memory, less memcpy)

* Python: Convert bro.py tests to unittest style (#478)

* Create unittest-style tests for `bro.py` decompression and compression
* Delete old tests for `bro.py`
* Update test method generation to properly create a Cartesian product
  of iterables using `itertools.product`

* Update python brotli wrapper
 * release GIL on CPU intensive blocks, fixes #476
 * use BrotliDecoderTakeOutput (less memory, less memcpy)
2016-12-12 10:27:13 +01:00
Alex Nicksay
4a60128c13 Python: Convert bro.py tests to unittest style (#478)
* Create unittest-style tests for `bro.py` decompression and compression
* Delete old tests for `bro.py`
* Update test method generation to properly create a Cartesian product
  of iterables using `itertools.product`
2016-12-09 13:44:05 +01:00
Alex Nicksay
1e5ea6aedd Python: Add unit tests for brotli.compress and brotli.decompress (#467)
Also
  - rename `test_utils` to `_test_utils`
  - refactor shared code into `_test_utils`
2016-11-09 12:21:13 +01:00
Alex Nicksay
a260b6ba73 Python: Add tests for streamed compression (#458)
Progress on #191
2016-10-31 13:24:01 +01:00
Alex Nicksay
9203765492 Python: Use "build" instead of "build_ext" in scripts (#460)
Previously, the Python package consisted of a single extension
module, so `build_ext` was sufficient.  Now, the package
contains a native module and an extension module, so both
`build_py` and `build_ext` are required.  Instead, run `build`,
which calls both `build_py` and `build_ext` automatically.
2016-10-31 12:58:45 +01:00
Alex Nicksay
afb1272792 Python: Publicly expose the Compressor object in the Python API (#456)
Progress on #191
2016-10-25 10:19:29 +02:00
Alex Nicksay
5632315d35 Python: Support streamed compression with the Compressor object (#448)
This adds `flush` and `finish` methods to the `Compressor`
object in the extension module, renames the `compress` method to
`process`, and updates that method to only process data.  Now,
one or more `process` calls followed by a `finish` call will be
equivalent to a module-level `compress` call.

Note: To maximize the compression efficiency (and match
underlying Brotli behavior, the `Compressor` object `process`
method does not guarantee all input is immediately written to
output. To ensure immediate output, call `flush` to manually
flush the compression buffer.  Extraneous flushing can increase
the size, but may be required when processing streaming data.

Progress on #191
2016-10-24 13:28:56 +02:00
Eugene Kliuchnikov
2d441179bb Merge pull request #446 from nicksay/py-3-compressor-object
Python: Create an extension Compressor object
2016-10-18 10:31:05 +02:00
Alex Nicksay
b04f4ea185 Python: Update README with information about code formatting
Also, add a `yapf` section to `setup.cfg` to ensure YAPF runs
format code with the Google style.
2016-10-17 13:57:56 -04:00
Alex Nicksay
595a5246b4 Python: Create an extension Compressor object
- Create a `Compressor` object in the extension module
- Move the `compress` method into the native module and use
  the new `Compressor` object to do the compression

Note: This does not change the module-level Python API.  The
`Compressor` object will not be publicly exposed until its
methods have stabilized.
2016-10-17 13:03:58 -04:00
Alex Nicksay
f7b5b3dc2c Python: Create native brotli module and move extension to _brotli 2016-10-17 09:35:27 -04:00
Eugene Kliuchnikov
86fdb68373 Update brotlimodule.cc 2016-09-21 16:02:32 +02:00
Eugene Kliuchnikov
7cbdb4aa0c Update brotlimodule.cc 2016-09-21 15:51:54 +02:00
Eugene Kliuchnikov
b754f607aa Update python module
* use new decoder API
2016-09-21 15:37:45 +02:00
Eugene Kliuchnikov
8148001158 Move "public" to "include/brotli" 2016-08-23 14:40:33 +02:00
Eugene Kliuchnikov
2c2d5578a6 Use version from common/version.h 2016-08-22 15:44:12 +02:00
Eugene Kliuchnikov
dae9c7ffd0 Fix brotlimodule 2016-08-22 14:00:42 +02:00
eustas
27f9d00efc Fix issue #383 2016-06-23 11:02:53 +02:00
eustas
81054a4667 Restore platform suffix 2016-06-17 20:24:24 +02:00
eustas
f0c7ece315 Remove platform suffix 2016-06-16 17:45:05 +02:00
eustas
bac060f1a1 Fix library path 2016-06-16 17:25:26 +02:00
Eugene Kliuchnikov
db3a11625d Fix CI build. 2016-06-13 15:22:13 +02:00
Eugene Kliuchnikov
b972c67780 Convert encoder to plain C. 2016-06-13 11:01:04 +02:00
eustas
b73ebe32b4 Fix test file path 2016-06-03 12:31:02 +02:00
eustas
66606e7d43 Fix test file path 2016-06-03 12:30:45 +02:00
eustas
bb6f5fea46 Merge pull request #336 from anthrotype/upload-sdist
appveyor: also upload source distribution packages to Github Releases
2016-06-03 11:12:12 +02:00
eustas
75c6c1abab Fix brotlimodule 2016-04-19 16:43:42 +02:00
Cosimo Lupo
f66c7c5442 python/tests: clean up generated files if successful 2016-04-10 20:52:27 +01:00
eustas
7e5bbd5f9b Merge pull request #321 from eustas/master
Add custom dictionary feature binding
2016-02-24 16:54:54 +01:00
Eugene Kliuchnikov
7d25e6b6fe Truncate dictionary to window size. 2016-02-24 16:01:35 +01:00
Eugene Kliuchnikov
cbb0d4cd73 Remove streaming test. 2016-02-23 17:45:42 +01:00
Eugene Kliuchnikov
30612e3a64 Add binding for custom_dictionary. 2016-02-23 17:42:55 +01:00
eustas
14276922dd Fix typo 2016-02-23 16:10:53 +01:00
eustas
7111c339ec Create README.md 2016-02-23 16:06:31 +01:00
Ilya Nazarov
291d21cc2f Fix choices for --lgwin and --mode in python/bro.py. 2016-02-19 16:54:15 +06:00
eustas
c5c80a9f3d Addressed comment 2016-01-25 15:13:17 +01:00
eustas
8e8b8de0e6 Update brotlimodule.cc 2016-01-25 12:33:38 +01:00
eustas
1b938dc7a2 Update brotlimodule.cc 2016-01-25 12:16:36 +01:00
eustas
c49918e1ee Update brotlimodule.cc 2016-01-25 12:07:39 +01:00
eustas
ca0ae4cbc0 Update brotlimodule.cc 2016-01-25 11:40:20 +01:00
eustas
a4f40c1b24 Fix brotlimodule compilation warnings 2016-01-25 11:39:05 +01:00
eustas
fec00d24e1 Make input const 2016-01-23 00:31:47 +01:00
eustas
a22993b312 Fix pointer dereferencing. 2016-01-22 14:09:25 +01:00
eustas
1f9106429a Remove deprecated API call 2016-01-22 14:01:46 +01:00