Skip to content

Conversation

white-gecko
Copy link
Contributor

The Recompressor so far was working on files.
With these changes:

  • Tests are added
  • Duplicated code in recompress() and load_and_write() resp. decompress_and_recompress() is deduplicated.
  • The file handling and operations in streams/file-like-objects is separated.
  • _load_and_write_stream() and _decompress_and_recompress_stream() work on streams
  • StreamRecompressor is introduced to work purely on streams:
    • recompress() handles properly compressed or uncompressed streams
    • decompress_recompress() handles any gzip compressed stream

The pull request is not yet organized in nice commits. If it is acceptable in general, I will rebase it and rework the commits, if required. If you prefer nicer commits for review, please tell me.

@wumpus wumpus self-requested a review September 18, 2024 04:53
@wumpus wumpus self-assigned this Sep 18, 2024
@wumpus
Copy link
Collaborator

wumpus commented Sep 18, 2024

Disorganization is fine because this is a squash sort of idea, and I can review the squash. I will get to this next week, I'm at a conference.

@white-gecko
Copy link
Contributor Author

To make things more complicated ;-) but also simpler to work with streams I have additionally introduced the RecompressorStream in my wip/recompressorStream branch deutsche-nationalbibliothek#1
(For sure, the names can not stay as they are.)

The motivation is, that I do lazy evaluation in my setup and don't know the target stream where I'm going to write to, at the moment, when I setup the recompression.

What do you think about these interfaces?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants