Seems like this script would be better with some real documentation (in the form of a reStructuredText file) rather than inline comments like this.