Code styles are the result of personal preferences, past experiences, and code editor settings (and plugins!). Discussing code style in code reviews is unproductive. Put code style checks in pre-commit hooks where they belong.
Code styles are the result of personal preferences, past experiences, and code editor settings (and plugins!). Discussing code style in code reviews is unproductive. Put code style checks in pre-commit hooks where they belong.
Now that I've covered the basics of monkeypatching, it's time to dig deeper.
When you monkeypatch a function, you're limited to accessing the function's parameters and other data in its global scope. This article is an introduction to one way that you could access data in the calling function's local scope.
Monkeypatching is a common word among Python programmers. But what is it?
This post is an introduction to monkeypatching.
Hynek Schlawack posted an article titled "Why you should document your tests". I think that you should document your individual assertions, too.
I've recently discovered the joys of JSON output from CLI apps.
I have to maintain code and narrative documentation for compliance reasons at work, but I don't want to separately update the documentation each time I update the code! Luckily, because I'm using Python and Sphinx, it's easy to the automatically update the docs.
A long time ago I inherited a big monolithic mess of Tera Term macro code. After a few years the code base had grown considerably and become extremely unwieldy. I finally decided that it was time to fix the problem and created some utility code that would allow me to …
It's been twelve days since my shoulder surgery so I thought I'd post a summary of what I've been up to.
In the first 24 hours there was an issue that cropped up at work. The problem was caused by an update to some software released by another group in …
My first programming language was some variant of BASIC on a VTech Precomputer 2000. Then one day I discovered that a copy of QBasic was included with DOS and began using it to program. I wrote software to add and subtract arbitrarily long strings of integers (I don't think I …
For a very long time I've been writing code at my job that automates some very tedious tasks. It's not Python code, though! It's a macro language that has saved the company a lot of time and energy but suffers from severe limitations:
I misread a recent feedparser bug report and thought that the author had mistyped a bbcode- or wiki-formatted link. Consequently, I wasted time debugging the code.
Turns out, I wasted a lot of time, because I spent more than zero time debugging the code. Yes, zero time. I was using …
After porting feedparser to Python 3, I've consistently tested every change on Python 2.4 through Python 3.1. That's four versions of Python 2, and two versions of Python 3. I've also started creating coverage reports for each test run, so I can ensure that the tests are reasonably …
One week ago I announced that I was going to port feedparser to Python 3. Two days ago, I wrote that I had one big question to answer: str
or bytes
?
Today I can say that str
was the correct answer: feedparser passes all 4055 unit tests in Python 3 …
I spent some time this weekend working on porting feedparser to Python 3, and found that it will be difficult because there are two separate parsers included (a strict parser and a loose parser), and while each works differently, both use the same core machinery in feedparser.
With the strict …
Today I'm announcing I'm throwing my hat in the ring to port feedparser to Python 3. There's a ticket open regarding this at the feedparser bug tracker, but the person who's working on porting it appears to be writing Python 3 code instead of writing Python 2 code that the …
I've finally "finished" my work on the rawdog rss plugin (which should realistically be called "syndication.py" or something similar). You can view the results at the rawdog-rss github repository. The plugin was originally authored by Jonathan Riddell, and was later updated by Adam Sampson. While I may leave the …
After previously noting that listparser chokes on invalid XML (as it should , but eventually won't ), I've taken it upon myself to patch the software that was creating invalid XML in the first place. I found that Planet KDE's FOAF blogroll was being created by a plugin for rawdog.
I wrote …
I switched feed readers a while back; I ditched Google Reader in favor of Liferea. Liferea brings some interesting features to the table that Google Reader didn't, like the automatic downloading of comments where available.
After using it for a while, I've begun to consider wrapping comment tracking and feed …
A few days ago I added support for tracking Wordpress.com comments, but its implementation leaves a lot to be desired, as I'm merely using comment feeds for the purpose.
The first problem is that Wordpress.com limits the number of comments in feeds to 10. Thus, it is very …
Earlier this month I wrote about scraping LiveJournal comments. What was I thinking?
While I was able to account for a number of variables in the page by tweaking my XPath statements, it became obvious early on that screen scraping for comments should be a last resort. So I decided …
As a first attempt at expanding my comment tracking software, I did a little testing in regards to scraping LiveJournal comments. Having written some uncomfortably convoluted XSL transformations in the past, I've become familiar with XPath. While BeautifulSoup has served me well in the past for quick excursions into the …
I have finally finished backing up all of my data. It took four DVDs, but I finally did it. It would have required several more had I not filtered my music files for backup, however. In particular, the only music that I truly had to save were the songs I've …
So I've been working like a fiend to import all of my comments from around the internet. It has been a herculean effort because almost everything has to be done manually. One comment here, another there, and no uniform way to extract those comments.
Two sites, however, made comment retrieval …
Django has made my web development life easier.
I don't like PHP. Sometime soon I hope to use something different.