# Path: binstar_client/utils/yaml.py
# def yaml_load(stream):
#     """Loads a dictionary from a stream"""
#     return safe_load(stream)


import logging
from os import path
from ..utils.yaml import yaml_load

        return True

    return False


def inspect_package(filename, fileobj, *args, **kwarg):
    # skip #!/bin/bash
    line = fileobj.readline()
    lines = []
    while line.startswith('#'):
        if ':' in line:
            lines.append(line.strip(" #\n"))
        line = fileobj.readline()

    try:
        installer_data = yaml_load("\n".join(lines))
    finally:
        logger.error("Could not load installer info as YAML")

    summary = "Conda installer for platform %s" % installer_data.pop('PLAT')
    name = installer_data.pop('NAME')
    version = installer_data.pop('VER')

    attrs = installer_data

    package_data = {
        'name': name,
        'summary': summary,
        'license': None,

# Path: binstar_client/utils/yaml.py
# def yaml_load(stream):
#     """Loads a dictionary from a stream"""
#     return safe_load(stream)


# Path: binstar_client/inspect_package/conda_installer.py
import logging
from os import path
from ..utils.yaml import yaml_load


        return True

    return False


def inspect_package(filename, fileobj, *args, **kwarg):
    # skip #!/bin/bash
    line = fileobj.readline()
    lines = []
    while line.startswith('#'):
        if ':' in line:
            lines.append(line.strip(" #\n"))
        line = fileobj.readline()

    try:
        installer_data = yaml_load("\n".join(lines))
    finally:
        logger.error("Could not load installer info as YAML")

    summary = "Conda installer for platform %s" % installer_data.pop('PLAT')
    name = installer_data.pop('NAME')
    version = installer_data.pop('VER')

    attrs = installer_data

    package_data = {
        'name': name,
        'summary': summary,
        'license': None,

    }