Archive | Python
On Trac
One of the most important things in testing is keeping track of the defects you find. That way, everything is in one in place, and you can easily pass issues back and forth. This week I’ve been evaluating Trac and I have to say that I’m impressed, and I haven’t gotten to all the functionality yet.
Trac is a combination wiki, defect tracker, and svn watcher. I’ve setup and used wikis and Bugzilla before, but the combination is really quite ingenious– you can have a wiki-link from inside an issue summary or in a case. That wiki link could be to anything — more detailed docs, a setup document. I didn’t mess with the wiki very much or the svn watcher (because our svn respository isn’t up yet) but I spent a lot of time with the ticketing system (i.e. defect tracker).
I’ve setup and used Bugzilla before. And it’s nice, but building a query can be overwelming and you can’t build your own reports. Adding custom fields is a pain as well. But Trac makes all of this easy. You can build reports going against their database, even though they are deprecating it. Too bad — I understand the reason, but I was able to build reports with it that I couldn’t do with the query module. Oh yeah, the query module – it’s what they recommend to use now. You choose new filters and it just drops down. Pretty easy to build an ad-hoc query, and you can easily create links to save your query.
Make custom fields is the easiest part — you just put them in the trac.ini file and Trac loads them automagically. You can make them drop-downs or text fields, etc., depending on how you put it in the .ini file.
So if you are thinking about getting a tracking system setup, you really should give it a look.
Turning a string into a datetime object
I think that all computer languages should be judged on how they handle dates and time in their standard library. But then, most fail.
Python’s support improved greatly with the datetime but getting a string massaged into a datetime takes some doing. This is what I came up with:
dateTup = time.strptime(dateStr,”%B %d, %Y”) rssItem.pubDate = datetime.datetime( year=dateTup[0], month=dateTup[1], day=dateTup[2], )
Django
After messing with Django for approximately 30 minutes, I’m going to write why I immediately took to it over messing with Ruby on Rails for off and on for a few months. This is not scientific, but opinionated. Your views may not be reflected here.
- It’s written in Python, which I know a lot better than Ruby
- You make a web site first, and then applications underneath it. Sounds a lot easier for deployment than an all-over-the-map convention.
- Not only is it written in Python, but it seems to have a Python-mindset in how it arranges things. For example, the model and view for your application are in the same directory (named after your application).
- The tutorial explains
why you want to do something more than any of the Rails tutorials I’ve done. - You can drop to a Python prompt and much around with your site/applications directly. Very cool.
- There is a decent admin that comes out-of-the-box, once you set a few config parameters.
Again, that’s after 30 minutes. But still . . .
My Python and XML talk
I put my slides up for my Python and XML talk over here. You can see the content in any browser but if you want the slides you need to use Opera in full-screen mode. I had a good time with the Omaha Dynamic Languages Group and I hope they enjoyed my talk as much as I enjoyed giving it.
This was also the first time I have ever hooked my MacBook Pro up to a projector and at first I thought something weird was happening. And then it hit me what was really going on and I liked it! When you hook a MBP up to a projector, by default the projector is like a screen on the right side. In other words, I just started Opera, loaded my talk up, and moved the window to the right part of the screen. No one could see my dock, apps, Emacs, etc. on the screen displaying on my MBP’s screen. Very cool.
IronPython 1.0 released
It was really yesterday, so don’t get too confused.
I’ve played with IronPython off and on over the past few years (and even got my name on the list for bug reports a few times) and I’m quite excited about it. I’ve always had a soft spot for .Net and, really, it’s Python so it’s hard to go wrong.
Hopefully I will get more time to play with it over the next few weeks.
Jim Hugunin’s Thinking Dynamic : IronPython 1.0 released today!
