Import processing
=================

All kinds of import statements are handled

    >>> from findimports import find_imports

    >>> with open('marmalade.py', 'w') as f: _ = f.write('''
    ... import sys
    ... import os.path
    ... import email.Message as EM
    ... from . import foobar
    ... from cStringIO import StringIO
    ... from cPickle import dumps as D
    ... from sys import (argv,
    ...                  exc_info as EI,  # complexity is fun
    ...                  exit)
    ... from email import *
    ... import imaginary.package
    ... ''')

    >>> for imp in find_imports('marmalade.py'):
    ...     print(imp)
    ImportInfo('sys', 'marmalade.py', 2, None)
    ImportInfo('os.path', 'marmalade.py', 3, None)
    ImportInfo('email.Message', 'marmalade.py', 4, None)
    ImportInfo('foobar', 'marmalade.py', 5, 1)
    ImportInfo('cStringIO.StringIO', 'marmalade.py', 6, 0)
    ImportInfo('cPickle.dumps', 'marmalade.py', 7, 0)
    ImportInfo('sys.argv', 'marmalade.py', 8, 0)
    ImportInfo('sys.exc_info', 'marmalade.py', 9, 0)
    ImportInfo('sys.exit', 'marmalade.py', 10, 0)
    ImportInfo('email.*', 'marmalade.py', 11, 0)
    ImportInfo('imaginary.package', 'marmalade.py', 12, None)

Note how we carefully try to make sure the line numbers are correct (e.g.
'exit' is shown as imported on line 10, even though the AST node says the
import statement began on line 8).
