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

Add tlog-play "output" option #253

Merged

Conversation

justin-stephenson
Copy link
Collaborator

Allow redirecting tlog-play output to a file with a new -o/--output option

This is in reference to #219

@spbnick @spoore1 Would you mind a quick review?

@coveralls
Copy link

coveralls commented Jun 20, 2019

Coverage Status

Coverage increased (+0.009%) to 29.524% when pulling 87ed8c0 on justin-stephenson:play_output_to_file into 7d24895 on Scribery:master.

@spbnick
Copy link
Member

spbnick commented Jun 24, 2019

I would say this is a bit too involved and expands the interface unnecessarily. Simply detect if stdout is a terminal or not (e.g. by checking errno after the failed tcgetattr, or with isatty), handle that appropriately, and let people use shell redirections, so that tlog-play >file.bin works.

Allow users to send tlog-play output to a file with -o by
redirecting stdout to a file.
with open(outputfile) as f:
read_data = f.read()
assert recordedtext in read_data
f.closed
Copy link
Contributor

Choose a reason for hiding this comment

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

Would misc.check_outfile() be better here? or don't want/need that here specifically?

@justin-stephenson justin-stephenson merged commit 0b1bc42 into Scribery:master Jul 10, 2019
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.

None yet

4 participants