Did I find the right examples for you? yes no

All Samples(3)  |  Call(1)  |  Derive(0)  |  Import(2)
Send the API request to package something.

All URLs in the metadata have to be real URLs that can be
accessed.

This method merely triggers the API call, it finishes well before the
actual package is made.

:param pkgme_service_root: The base URL of a pkgme service
:param metadata: A metadata dictionary.  Should contain at least(more...)

        def build_package(pkgme_service_root, metadata):
    """Send the API request to package something.

    All URLs in the metadata have to be real URLs that can be
    accessed.

    This method merely triggers the API call, it finishes well before the
    actual package is made.

    :param pkgme_service_root: The base URL of a pkgme service
    :param metadata: A metadata dictionary.  Should contain at least
        'callback_url', 'errback_url' and 'package_url' keys.
    """
    try:
        # XXX: This creates a celery task. If there's any way to hook up
        # an event for if that task fails we should do it.
        return _build_package(pkgme_service_root, metadata)
    except SocketError, e:
        raise
    except APIError, e:
        body = e.body
        data = getattr(e, 'data', "(unavailable)")
        if body is not None:
            try:
                body = parse_json(body)
            except ValueError:
                # not json
                pass
        raise RuntimeError(
            "API request failed: %s\n"
            "Data:\n"
            "%s\n"
            "Body:\n%s" % (e.msg, pformat(data), pformat(body)))
        


src/t/x/txpkgme-0.3/txpkgme/harness.py   txpkgme(Download)
from twisted.web.server import Site
 
from pkgme_service_client.client import build_package
 
from .utils import parse_json
    def send_request(callbacks, metadata):
        metadata.update(callbacks)
        build_package(pkgme_service_root, metadata)
    d = run_with_callbacks(webserver, timeout, clock, send_request, metadata)
    return d.addErrback(wrap_pkgme_service_error)

src/p/k/pkgme-service-python-0.3/pkgme_service_client/tests/test_client.py   pkgme-service-python(Download)
from testtools import TestCase
 
from pkgme_service_client.client import build_package