Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libinithooks updates #56

Merged
merged 6 commits into from
Jul 22, 2024
Merged

Conversation

JedMeister
Copy link
Member

@JedMeister JedMeister commented Jul 16, 2024

  • Add inithooks_log library
  • libinithooks styling updates (black)
  • inithooks_cache changes:
    • support setting cache dir at Keystore class initialisation - not just via env var
    • support providing fallback value for read()

turnkeylinux-apps/nextcloud#28 depends on this

@JedMeister JedMeister changed the title Add inithoooks_log module libinithooks updates Jul 17, 2024
@JedMeister
Copy link
Member Author

In discussion with @OnGle regarding the changes to inithooks_cache, he noted that I've changed the default behaviour of .read().

When calling read(), my changes added support for proving a fallback value - which would be returned if the key does not exist in the cache. My idea was based on the behavior of os.environ when getting an env var.

However with my changes, if a cached value does not exist and no fallback is given, an empty string is returned. Previously None would be returned.

While I think that returning an empty string would be preferable (particularly for typing), @OnGle's point was that the change may have unintended negative consequences in existing uses of inithooks_cache elsewhere. I think that's fair.

libinithooks/inithooks_log.py Show resolved Hide resolved
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