Giveaway! Name this book, win tasty food

SWALLOW YOUR SOUL
Terrifying Ellis Island teddy via Big Lug Land

The other day I remembered a book from my upbringing, and now not knowing how to find it is making me deranged.

First person to name this book wins their choice of a box of Quest Bars or Pacific Cookie Company cookies, plus my substantial gratitude.

Details:

Spotted in Christian middle school library circa 1990. Picture book. 4th-grade reading level? Rich, dark spooky realistic color illustrations (pastel? Oil paint?)

Story is about a room full of toys fighting off an evil toy (jack-in-the-box?) Leader of good toys is teddy bear and probably a Jesus allegory.

Teddy bear gets horribly mutilated by baddie. Stuffing torn out. New stuffing can’t save him. Good toys figure out the only way he can be saved is if each of them gives up a little of their stuffing for him. They save him this way, I think.

So allegory kind of falls apart at the end. But there it is.

Help a nerd out?

Telnetlib not reading all output? Try asynchat

Telnetlib not reading all output? Not receiving all the output from your telnetlib session? read_until() not an option because you don’t know what output to look for? telnetlib not queueing your writes?

Think you want a telnetlib alternative, but Google isn’t turning anything up?

I’ve been there.

Headbanging Gods of Metal Traveller
There was head-banging, but it was not a ball
Image stolen from Metal Traveller

After a couple of days of madness I learned a few things:

– In Maya at least, not all output generated by the server is available to be read. I can call print("foo") all day and never read back “foo” on the client. Apparently it is known that “python print does not appear in certain output”. I ended up using the mel warning command, and if you think that sounds like overkill you are probably right.

– After much much much Googling, this stackoverflow answer pointed me to asynchat. I ended up writing a tiny client by extending asynchat, and Turns out I didn’t want a telnetlib alternative; I wanted a module that did much less!

not a python but still happy

Not a python but still happy

telnetlib doesn’t seem to queue writes. You can send two writes in a row, but there’s no guarantee the second one will be received by the server. Troublesome if you’re trying to use a second write as a way to determine when the first write has finished executing. Fortunately asynchat.push() works like a boss.

– More information and a code sample can be found at stackoverflow. I have personal insight on a code problem about once in a bazillion years, so this is very exciting to me.

If this post helps one person headbang only by choice, I have succeeded.