internetarchive/CDX-Writer — pull request #2 by jcushman (2014-01-19 02:49:45+00:00)
Title: Make package work as library as well as from command line.

(I wasn't sure if this should be sent to @internetarchive or @rajbot -- let me know.)

This pull req. changes CDX-Writer so it can be imported from other Python packages, rather than assuming that it will run from the command line. (Writing to a file handle instead of calling print, throwing exceptions instead of calling sys.exit(), etc.)

It should still work from the command line as well, but I haven't tested that side of things.