|
17 | 17 |
|
18 | 18 | READ, WRITE = 1, 2 |
19 | 19 |
|
20 | | -COMPRESS_LEVEL_FAST = 1 |
21 | | -COMPRESS_LEVEL_TRADEOFF = 6 |
22 | | -COMPRESS_LEVEL_BEST = 9 |
| 20 | +_COMPRESS_LEVEL_FAST = 1 |
| 21 | +_COMPRESS_LEVEL_TRADEOFF = 6 |
| 22 | +_COMPRESS_LEVEL_BEST = 9 |
23 | 23 |
|
24 | 24 |
|
25 | | -def open(filename, mode="rb", compresslevel=COMPRESS_LEVEL_BEST, |
| 25 | +def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_BEST, |
26 | 26 | encoding=None, errors=None, newline=None): |
27 | 27 | """Open a gzip-compressed file in binary or text mode. |
28 | 28 |
|
@@ -126,7 +126,7 @@ class GzipFile(_compression.BaseStream): |
126 | 126 | myfileobj = None |
127 | 127 |
|
128 | 128 | def __init__(self, filename=None, mode=None, |
129 | | - compresslevel=COMPRESS_LEVEL_BEST, fileobj=None, mtime=None): |
| 129 | + compresslevel=_COMPRESS_LEVEL_BEST, fileobj=None, mtime=None): |
130 | 130 | """Constructor for the GzipFile class. |
131 | 131 |
|
132 | 132 | At least one of fileobj and filename must be given a |
@@ -520,7 +520,7 @@ def _rewind(self): |
520 | 520 | super()._rewind() |
521 | 521 | self._new_member = True |
522 | 522 |
|
523 | | -def compress(data, compresslevel=COMPRESS_LEVEL_BEST): |
| 523 | +def compress(data, compresslevel=_COMPRESS_LEVEL_BEST): |
524 | 524 | """Compress data in one shot and return the compressed string. |
525 | 525 | Optional argument is the compression level, in range of 0-9. |
526 | 526 | """ |
@@ -551,11 +551,11 @@ def main(): |
551 | 551 | parser.add_argument("args", nargs="*", default=["-"], metavar='file') |
552 | 552 | args = parser.parse_args() |
553 | 553 |
|
554 | | - compresslevel = COMPRESS_LEVEL_TRADEOFF |
| 554 | + compresslevel = _COMPRESS_LEVEL_TRADEOFF |
555 | 555 | if args.fast: |
556 | | - compresslevel = COMPRESS_LEVEL_FAST |
| 556 | + compresslevel = _COMPRESS_LEVEL_FAST |
557 | 557 | elif args.best: |
558 | | - compresslevel = COMPRESS_LEVEL_BEST |
| 558 | + compresslevel = _COMPRESS_LEVEL_BEST |
559 | 559 |
|
560 | 560 | for arg in args.args: |
561 | 561 | if args.decompress: |
|
0 commit comments