Commit Graph

13 Commits

Author SHA1 Message Date
dgelessus
3a72bd3406 Remove leading underscores where they don't make much sense
The leading underscore is meant to distinguish private (for internal
use only) APIs from public (for external use) APIs. One can argue about
where the line between public and private should be, but if something
is used from other modules (as with read_variable_length_integer) it's
not really private IMHO.

In scripts (like __main__) it also doesn't make much sense to use
leading underscores, because the entire file is never meant to be used
by external code.
2019-10-01 21:26:41 +02:00
dgelessus
e0f73d3220 Fix more issues reported by mypy 2019-09-29 16:28:07 +02:00
dgelessus
e5875ffe67 Fix various issues reported by mypy 2019-09-29 16:14:55 +02:00
dgelessus
0ac6e8a3c4 Fix misplaced parens in dcmp modules 2019-09-29 15:33:14 +02:00
dgelessus
97c459bca7 Change attribute type annotations to standard format
Previously, the types of instance attributes were annotated with the
first assignment of each attribute. The standard way to annotate
instance attributes is to do so at class level without assigning any
value.
2019-09-29 14:58:18 +02:00
dgelessus
0c942e26ec Fix hex number formatting in compressed header info reprs 2019-09-23 23:52:06 +02:00
dgelessus
868a322b8e Add Resource.compressed_info attribute
This allows accessing a compressed resource's header data, without
having to decompress it or parse the compressed data manually.
2019-09-23 23:50:29 +02:00
dgelessus
a23cd0fcb2 Simplify decompressor lookup
All decompressors now have exactly the same signature (as a result,
each decompressor now has to check itself that the header type is
correct). This allows the decompressors to be stored in a simple
dictionary, which makes the lookup process much simpler.
2019-09-23 23:32:38 +02:00
dgelessus
53e73be980 Pass complete header info to individual decompressors 2019-09-23 23:19:20 +02:00
dgelessus
9dbdf5b827 Move compressed header info constants/classes to .compress.common
This allows the constants/classes to be accessed from the individual
decompressor submodules.
2019-09-23 23:14:06 +02:00
dgelessus
87d4ae43d4 Refactor parsing of compressed resource headers
In preparation for #3, the compressed resource data headers are parsed
and stored as proper objects. For now these objects are only used
internally by the decompression code, but in the future they can be
exposed.
2019-09-23 23:10:55 +02:00
dgelessus
3e28fa7fe0 Fix typos 2019-08-24 23:38:07 +02:00
dgelessus
8904f6e093 Refactor the rsrcfork.compress module into separate submodules
Each decompressor now has its own module, since they share almost no
code between each other.
2019-08-22 21:20:35 +02:00