danielgtaylor/qtfaststart — pull request #8 by jaraco (2013-07-05 16:16:17+00:00)
Title: Python 3 support and other improvements

I'm interested in exploring the use of this package to re-write co64 chunks as stco chunks (if the file size can support it). In investigating the package, I found there were areas where I thought I could improve it.

I realize this is a pretty big pull request, but I took each commit carefully and deliberately, describing what it does, and many of the subsequent commits do depend on the earlier ones. I don't suggest reading the unified diff, but instead read the diffs for each changeset chronologically.

Here are some highlights:

1. Added support for Python 3. The current implementation drops support for Python 2.5 and earlier, but support for Python 2.4+ can be restored if desired (by incorporating compatibility modules).
2. Allow invocation of the script with 'python -m qtfaststart'. This allows an easily-accessible endpoint for Windows users or other environments where bin/qtfaststart isn't convenient.
3. Created an Atom namedtuple to represent a fourcc atom (name, stream position, and size).
4. Refactored parts of the code to utilize Atoms directly. Backward compatibility has been maintained (by the creation of private _*_ex functions. When backward compatibility of the package is no longer necessary, the private functions can replace the public ones.

I'll probably be continuing to contribute to this package, but I wanted to make this pull request to share my changes and get feedback sooner than later. I hope you find these changes appealing to the project.