Created
August 13, 2012 21:47
-
-
Save aheadley/3344315 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import packagetrack | |
import sys | |
packagetrack.carriers.__carriers = {} | |
packagetrack.carriers.register_carrier( | |
packagetrack.carriers.dhl_interface.DHLInterface, | |
packagetrack.configuration.NullConfig()) | |
for tn in sys.argv[1:]: | |
try: | |
pkg = packagetrack.Package(tn) | |
print pkg | |
info = pkg.track() | |
print info | |
print info.events | |
except Exception as err: | |
print 'ERROR: %s: %s' % (err.__class__.__name__, err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment