Skip to content

feat(mobi): allow to pass custom arguments to kindlegen#730

Closed
BoboTiG wants to merge 1 commit into
ilius:masterfrom
BoboTiG:feat-mobi-kindlegen-args
Closed

feat(mobi): allow to pass custom arguments to kindlegen#730
BoboTiG wants to merge 1 commit into
ilius:masterfrom
BoboTiG:feat-mobi-kindlegen-args

Conversation

@BoboTiG

@BoboTiG BoboTiG commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This patch keeps the current behavior and add the capability to pass custom arguments to kindlegen.

Benefits:

  • It allows to pass -verbose in non-debug runs (I wanted that without having to be flooded by DEBUG logs).
  • It allows to switch to Kindling without changing anything more on your side.

Changes tested locally with success.

@BoboTiG

BoboTiG commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Ah, I just see I simply revisited my old PR #628... I completely forgot about that 😅

The use case here is still valid. Moving to Kindling is the only option for the present and future, and it has several interesting arguments that one would want to use without using a PyGlossary fork.

@ilius

ilius commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Would using an environment variable solve that problem?

Because I think anyone who knows enough to set the extra args via options in UI, can just run the kindlegen command afterwards.
Also kindlegen is deprecated I think.

@BoboTiG

BoboTiG commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Kindlegen deprecation is a joke: it is so since 2014, and then Amazon did not care sharing a decent tool for Linux developers. So it is still in use 12 years later. That's not a problem, just the reality of the situation.

The good news is this new tool in the game: Kindling. But it is too young and doesn't work yet as a replacement for kindlegen.

Whatever you decide to do with MobiPocket support in PyGlossary, we will need a way to pass additional arguments for Kindling: there are way more options possible and covering all cases won't be possible. Even good defaults could be potentially debated.

About your proposal, I will be happy with whatever option you think is better as soon as we can provide more arguments to kindlegen/kindling :)

That's also true that I can use PyGlossary only partially and call kindlegen/kindling in a second manual pass; it's just way more convenient to use PyGlossary to do all the work since it allows us to easily centralize the code (for instance in reader.dict I've one method to call PyGlossary with different options given the desired output format. But that's only my use case and shouldn't drive the general path for this project).

Do you plan to deprecate, and remove, MobiPocket support from PyGlossary at some point?

I'm OK with closing the PR and deal with kindlegen/kindling on my end :)

@ilius

ilius commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Do you plan to deprecate, and remove, MobiPocket support from PyGlossary at some point?

No.

Let's use os.getenv for the extra args for now.

@BoboTiG

BoboTiG commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Closing this one since Kindling is now using envars. No need to complexify here.

@BoboTiG BoboTiG closed this Jun 27, 2026
@BoboTiG BoboTiG deleted the feat-mobi-kindlegen-args branch June 28, 2026 20:55
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