Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Search in the Packages pointed by an Index

:param index_spec:
    - a string in the form of **<scheme>://**, where
        - **<scheme>** identifies the type of index to be used
        - Example: *ckan://*
:type index_spec: str

:param query:
    a string specifying the query to be executed.(more...)

        def search(index_spec, query):
    """Search in the Packages pointed by an Index

    :param index_spec:
        - a string in the form of **://**, where
            - **** identifies the type of index to be used
            - Example: *ckan://*
    :type index_spec: str

    :param query:
        a string specifying the query to be executed.
        Ex: iso

    :return:
        - [:py:class:`Package `] -- A list of Packages pointed by the Index satisfying the query
        - [] -- on no results
    """
    spec_from = index_spec
    index, path = index_from_spec(spec_from)
    packages = []
    try:
        for package in index.search(query):
            packages.append(package)
    except ckanclient.CkanApiNotAuthorizedError:
        pass #TODO: just a workaround now
    return packages
        


src/d/a/datadeck-0.4.0/datadeck/operations.py   datadeck(Download)
    def run(self):
        wx.PostEvent(self.m_wxobject,
            OperationMessage(self.__class__, OPERATION_STATUS_ID["started"]))
        try:
            results = dpm.lib.search("ckan://", self.query)

src/d/p/dpm-0.10/dpm/tests/test_lib_internet.py   dpm(Download)
    def test_search(self):
        test_package = lib.search(CKAN_SPEC, PACKAGE_NAME)
        assert len(test_package) > 0
        assert test_package[0].name == PACKAGE_NAME
 

src/d/p/dpm-old-HEAD/dpm/tests/test_lib_internet.py   dpm-old(Download)
    def test_search(self):
        test_package = lib.search(CKAN_SPEC, PACKAGE_NAME)
        assert len(test_package) > 0
        assert test_package[0].name == PACKAGE_NAME