'Convert directory path to uri'

def _path2uri(self, dirpath):

    relpath = dirpath.replace(self.root_path, self.package_name)
    if relpath.startswith(os.path.sep):
        relpath = relpath[1:]
    return relpath.replace(os.path.sep, '.')
