Skip to content

[WASM] Make setStdout arguments more explicit in what they print to #654

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

Merged
merged 6 commits into from
Mar 13, 2019

Conversation

coolreader18
Copy link
Member

So a string doesn't mean a CSS selector anymore it means a string enum of, for now, just "console", and undefined means nothing, and an HTMLTextAreaElement is a textarea console to print to.

@coolreader18 coolreader18 changed the title [WASM] Change setStdout to take "console" instead of undefined to print to the console, and an HTML element instead of a CSS selector to print to a textarea [WASM] Make setStdout arguments more explicit in what they print to Mar 10, 2019
@palaviv
Copy link
Contributor

palaviv commented Mar 11, 2019

You should probably update the documentation in the demo.

@palaviv
Copy link
Contributor

palaviv commented Mar 11, 2019

This is a great change. I actually needed it at some point when I added the interactive shell :). Why does it have to be a textarea?

@coolreader18
Copy link
Member Author

That's what we use for the demo, and I think that if you're going to set stdout to an HTML element, it should probably be a textarea due to the way it's displayed. I might add support for other HTML elements just using textContent, though.

@palaviv
Copy link
Contributor

palaviv commented Mar 11, 2019

That's what we use for the demo, and I think that if you're going to set stdout to an HTML element, it should probably be a textarea due to the way it's displayed. I might add support for other HTML elements just using textContent, though.

I actually think that we should keep only the function option. The textarea is too specific and can be done simply by using a js function.

@coolreader18
Copy link
Member Author

Alright, that's sort of vestigial anyway from when the wasm crate was specific to just the demo.

@coolreader18
Copy link
Member Author

Oh, and I'll update the docs in a separate PR, cause there's a lot that's changed since they were written.

@windelbouwman windelbouwman merged commit 8dcea92 into RustPython:master Mar 13, 2019
@coolreader18 coolreader18 deleted the wasm-explicit-stdout branch March 13, 2019 13:21
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.

3 participants