[tinypy] Issue 49 in tinypy: Patches for stdout/stderr/stdin callbacks

17 views
Skip to first unread message

codesite...@google.com

unread,
May 8, 2010, 7:29:01 AM5/8/10
to tin...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 49 by darkuranium: Patches for stdout/stderr/stdin callbacks
http://code.google.com/p/tinypy/issues/detail?id=49

Hello,

there has always been a need (at least for me) to redirect the output of
print() to somewhere else than stdout, especially lately, as I was
programming PSP-related things with TinyPy.

Here, I submit 3 patches and 1 new file for this - they are based off the
latest SVN revision (R148).
I did not know how the functions and types should be named, and therefore
may be currently named rather confusingly - feel free to change this if you
do decide to put this into trunk.

The patches were tested on Windows with the default TinyPy runner (just to
verify that it still works as usual) and with with PSP (on which I did use
callbacks).

At the moment, the compiler complains about tp_stderr and tp_stdin being
defined and not used - I've just added them for future use, feel free to
comment them out.

Attachments:
setup.py.patch 1.5 KB
tp.c.patch 33 bytes
tp.h.patch 1.1 KB
callbacks.c 730 bytes

--
You received this message because you are subscribed to the Google Groups "tinypy" group.
To post to this group, send email to tin...@googlegroups.com.
To unsubscribe from this group, send email to tinypy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tinypy?hl=en.

codesite...@google.com

unread,
May 8, 2010, 7:33:03 AM5/8/10
to tin...@googlegroups.com

Comment #1 on issue 49 by darkuranium: Patches for stdout/stderr/stdin
callbacks
http://code.google.com/p/tinypy/issues/detail?id=49

By the way, this should be put under the "enhancement" type.

codesite...@google.com

unread,
May 8, 2010, 7:45:10 AM5/8/10
to tin...@googlegroups.com

Comment #2 on issue 49 by darkuranium: Patches for stdout/stderr/stdin
callbacks
http://code.google.com/p/tinypy/issues/detail?id=49

Hmm, I have just realized a possible improvement - this could (and should)
be done on
a per-vm basis - but before I start with that (as it would require changes
in the
structure of tp_vm), I would like to know what do you think so far?

codesite...@google.com

unread,
May 8, 2010, 7:49:17 AM5/8/10
to tin...@googlegroups.com

Comment #3 on issue 49 by darkuranium: Patches for stdout/stderr/stdin
callbacks
http://code.google.com/p/tinypy/issues/detail?id=49

Also, the typedefs might actually not be required...

codesite...@google.com

unread,
May 8, 2010, 9:32:17 AM5/8/10
to tin...@googlegroups.com

Comment #4 on issue 49 by darkuranium: Patches for stdout/stderr/stdin
callbacks
http://code.google.com/p/tinypy/issues/detail?id=49

Deleted above patches, as I added a new set of them... This time, the
callbacks are
set on a per-VM basis, with (in my opinion) much more clear syntax/types.



Attachments:
setup.py.patch 1.5 KB
tp.c.patch 33 bytes
tp.h.patch 1.2 KB
vm.c.patch 654 bytes
callbacks.c 768 bytes

codesite...@google.com

unread,
May 8, 2010, 9:41:37 AM5/8/10
to tin...@googlegroups.com

Comment #5 on issue 49 by darkuranium: Patches for stdout/stderr/stdin
callbacks
http://code.google.com/p/tinypy/issues/detail?id=49

Same set of patches, in ed script form, accepted by the patch tool (I
noticed that I
forgot the -e argument to diff earlier...)

Attachments:
e_setup.py.patch 691 bytes
e_tp.c.patch 32 bytes
e_tp.h.patch 890 bytes
e_vm.c.patch 365 bytes

codesite...@google.com

unread,
Jun 29, 2010, 11:00:23 AM6/29/10
to tin...@googlegroups.com

Comment #6 on issue 49 by darkuranium: Patches for stdout/stderr/stdin
callbacks
http://code.google.com/p/tinypy/issues/detail?id=49

I've deleted the patches since I've noticed that simply modifying the
builtin print() function works.
However, if anyone is interested, I've included some new patches, with new
(cleaner) code and no new file.

Attachments:
cbio.patch 2.0 KB

Reply all
Reply to author
Forward
0 new messages