Saturday, April 16, 2011

Making Decorators and Taking Advice

Decorators for Web Service Data Collection
There are a lot of funny things that can happen when pulling web service data for the Uncle Squirrely project.  Connections failures, page mismatches, or general web service errors can hit without warning.  These can cause my database update scripts to crash and burn. 

Because of the apparent randomness of the errors, the best response is to make reattempts.  This requires a "re-attempt" loop.  The problem is that wrapping these loops around existing logic and exception handling can be messy.

This is one area where Python decorators shine.  With a decorator, I can wrap the entire web service method into a separate object that takes care of the reattempt business for me.  That way, I can give random connection failure a second or third chance to recover without having to clutter up the code.  The RecoverWSExceptions class I wrote was extremely useful in keeping this all clean for me.

Blender Python Tutorials Advice

I asked the Blender Artists community what I could do to make Blender Python Tutorials better.  Their advice was to add blend files and screencasts.  Adding blend files was easy.  It was just a matter of creating the files, adding code, and modifying things to ensure they would work with the new Blender 2.57 release.  Piece of cake.

Screencasting, on the other hand, is hard.  The Ubuntu tools I found were pretty quirky.  The good news is I was able to work through a lot of the technical hurdles for using tools like Audacity and XVidCap.  I guess it's one of those things that are inevitable when you start getting more serious about 3D.  At some point, you're going to have to wear that a/v engineer hat.

And then there's the part I play the performing artist and step up to the microphone.  Doing a good verbal performance is hard.  I've cranked out 3 attempts at the "Hello World" tutorial and I'm not satisfied with any of them so far.  It made me respect performers great and small who put themselves out there doing that for a living.

 So that's about it for now.  It definitely was an interesting week and hope to get new stuff out this week.  Cheers.

No comments:

Post a Comment