lazyweb code review

I’m writing a tool in python that will automate the posting of the weekly newsletters for the film club. Currently, I manually post to LiveJournal, Craigslist, the SNFC webpage, and the mailing list. I had a tool a long time ago but it broke for various reasons.

Anyway, I want to have a directory of .py containing classes, and call a method [execute()] on each of them. This way I can just create a new subclass, pop it in that directory, and it will be picked up automatically. This is what I came up with, somehow I feel it’s crude and there is a better way to do it (ignore bad var names pls):

plugins = glob.glob("plugins/*.py")

for x in plugins:
pathName = x.replace(".py","")
className = x.replace(".py","").replace("plugins/","")

foo = __import__(pathName,globals(), locals(), [''])
bar = getattr(foo,className)

obj = bar()

obj.execute(nl)

This code looks for all of the .py files in the dir, imports them, gets the class from the imported module, and instantiates them. Finally, it calls the execute() method. Any suggestions?

Bulleted Quasi-Unrelated Information

  • Last Sunday I caught Blackballed: The Bobby Dukes Story with the film club. It’s a Paintball Mockumentary starring Rob Corddry from the Daily Show. Funny, but you don’t need to see it in a theatre, and you won’t be rolling around on the floor paralyzed from laughter.
  • For whatever reason the past few weeks I decided to catch up with the rest of the world and watch 24. I had watched about half of the first season about a year ago when I was laid up with my leg. I enjoyed the episodes I watched then, but somehow got distracted and never finished it. Well, last weekend I picked up that torch and blew through like 12 episodes of the first season, and moved directly into the second season, which I finished a few nights ago. The show is way over the top, but it’s fun, and eliminating the week-to-week suspense by waiting several years to start the series makes it less frustrating. My dad watches the show, so I’ve seen a few episodes of the third season, from when I was living at home again, but I had no idea what was going on when I was watching it… I watched the first episode of the third season directly after the last episode of the second, which was good, because they left a serious cliffhanger going on there that would have driven me crazy.
  • My new phone is pretty nice so far, but there are a few things that frustrate me. A few of you have asked for a review, I’ll get to that in a week or two, or something.

MovieOS is Universal

The Wall Street Journal is running an article on portrayals of computing and the Internet in film. I had plenty of discussions at CSH about the lame treatment of these topics by Hollywood. We even had a term to refer to the mystical graphical operating systems used in these films: MovieOS. Well, last night, I learned that these gripes are not limited to computer nerds.

was watching “The Ninth Gate” (despite my strong admonition) when I got home from the film club, and she instantly went off into a tirade. Some of the choice highlights were:

  • “No real rare book dealer would smoke around his collection!”
  • “Look at this guy, he’s supposedly the worlds most reputable rare book dealer but his books are piled up next to a live fireplace!”
  • “Come on! Nobody would store a book with it’s spine facing UP! ALL THE PAGES WOULD FALL OUT!”

I was telling this story to this morning, and he told me of a guy who was complaining about the portrayal of lead miniature painting techniques in “The 40 Year Old Virgin”. So clearly, these feelings are universal among geeks, and aren’t limited to the computer variety.

New Phone has Landed

I got my new phone yesterday, and it was activated this afternoon. It seems that not all the services have finished catching up in the move from T-Mobile to Cingular, so while I seem to be able to receive voice calls, Text Messages and other data kinds of things seem to be blackholed for now. Hopefully this will clear up soon, otherwise I will give Cingular’s support it’s first go-around… Anyway, be aware that there may be some hiccups in the next few days as the carriers catch up…

SubEthaEdit for Free!

Since learning about SubEthaEdit from CodingMonkeys, I always felt it would have been a great piece of software to have access to while in college. The thought of collaborative notetaking seems very powerful. Anyway, there is some special pricing today on SEE as part of BLOGZOT 2.0 on MacZOT.com. The software starts out at a discount of $5, and every weblog/journal post about it (like this one) submitted to them will decrease the price by 5 cents, eventually making it free. That would mean that MacZOT and TheCodingMonkeys will award $105,000 in Mac software back to the community that made this sale possible. Sounds like some kind of crazy pyramid scheme, but it is sure to generate tons of buzz!

The Dresden Dolls

and I caught The Dresden Dolls last night at the Orpheum. It’s crazy to see a local band go from tiny little clubs to (apparently) selling out the Orpheum. We got there just as the second opener, Humanwine was finishing their set… Totally not my thing, and I believe that every one of their songs had the word “bone” in the lyrics, but hey, whatever.

There was some of the usual circus antics between them and the Dolls. Our seats, which looked great on paper, were terrible. Although we were only four rows back from the stage, Amanda was almost completely obscured by the amps, and so we spent the whole show leaning over to try and see both members of the band at once. Brian hit as hard as ever, and Amanda’s voice was about as “on” as it’s ever been. They seemed to play for like 2 hours, playing tons of covers as well as most of their new album, “Yes, Virginia”. It was a fantastic show, even if it went way past Corinna’s bedtime… :)