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

Revise the way outputs are printed to the console #25

Open
matthewcarbone opened this issue May 13, 2024 · 2 comments
Open

Revise the way outputs are printed to the console #25

matthewcarbone opened this issue May 13, 2024 · 2 comments

Comments

@matthewcarbone
Copy link

This has been causing me some headaches:

def redirect_stdout(dst):

Every time PdfFit is instantiated, there is a block of text printed to the console. This similarly happens in other situations. I cannot catch this output because within the PdfFit.__init__ there is another line that globally overwrites stdout, making it impossible for me to redirect using e.g. a context manager. I'm not sure this is good practice: is there any particular reason this is done? I understand that it's important to the authors to display the copyright statements and whatnot, but surely it's reasonable to allow the user to disable this?

I have two suggestions:

  1. Simply use print, instead of redirecting stdout, allowing users to catch this in an outer context
  2. Allow the user to disable this block when initializing PdfFit.

Thanks!

@sbillinge
Copy link
Contributor

sbillinge commented May 14, 2024 via email

@sbillinge
Copy link
Contributor

Note to selves, consult with @8bitsam when we turn to this. He played with this a bit and i think found issues in resolving it.

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

No branches or pull requests

2 participants