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

fix tempfile and new output in conky module #2273

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

ntorresalberto
Copy link
Contributor

@ntorresalberto ntorresalberto commented Nov 21, 2024

This patch includes:

Fixes for 2 problems:

  • Conky has a new output that should be ignored
    In my case, with conky 1.21.7-pre- (default version with latest Fedora) outputs conky: 'i3' x11 session running 'i3' desktop
  • For some reason NamedTemporaryFile needs delete_on_close=False (which I thought was implied by delete=False, but apparently that is not the case)

A small refactor:

  • renamed invalid_conky_errors to ignored_conky_outputs as they're actually just expected outputs that we don't care about (and not really runtime problems requiring a warning/exit/exception)

Copy link
Contributor

@lasers lasers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine. Untested. Thank you for looking into this.

py3status/modules/conky.py Show resolved Hide resolved
@ultrabug ultrabug merged commit 2422a43 into ultrabug:master Dec 3, 2024
7 checks passed
@ultrabug
Copy link
Owner

ultrabug commented Dec 3, 2024

Thanks a lot @ntorresalberto and @lasers

@voh9eepah
Copy link

The latest Python for FreeBSD is 3.11, and there NamedTemporaryFile does not have a delete_on_close parameter.

However, with Python 3.11 the self.tmpfile = NamedTemporaryFile(prefix="py3status_conky-", suffix=".conf", delete=False) seems to work just fine.

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.

4 participants