Translates paths to *.py? files into module paths.

        >>> _path_to_module("rapport/bar.py")
        'rapport.bar'
        >>> _path_to_module("/usr/lib/rapport/bar.py")
        'rapport.bar'

def _path_to_module(path):
    """Translates paths to *.py? files into module paths.

        >>> _path_to_module("rapport/bar.py")
        'rapport.bar'
        >>> _path_to_module("/usr/lib/rapport/bar.py")
        'rapport.bar'
    """
    # Split of preceeding path elements:
    path = "rapport" + path.split("rapport")[1]
    # Split of ending and replace os.sep with dots:
    path = path.replace(os.sep, ".").rsplit(".", 1)[0]
    return path