Closed rufuspollock closed 12 years ago
If I correctly understand the internal mechanisms, what about listing all packages pointed by a FileIndex? Can it be still useful?
They can just do search with a blank query.
Good. I will keep it at the library level, by just calling the search function. It seems more elegant, even if it seems redundant Il giorno 08/nov/2011 18:40, "Rufus Pollock" < reply@reply.github.com> ha scritto:
They can just do search with a blank query.
Reply to this email directly or view it on GitHub: https://github.com/okfn/dpm/issues/27#issuecomment-2670745
@rgrp, I need some help here. I would like to search with a blank query:
$ dpm search ckan:// Insufficient arguments. See command help
Ok, this is obvious
dpm search ckan:// "" --debug DEBUG:dpm.index:dpm: CKAN config: {'base_location': 'http://thedatahub.org/api', 'api_key': '*****'} 2000-us-census-rdf -- 2000 U.S. Census in RDF (rdfabout.com) 2001-spanish-census-to-rdf -- 2001 Spanish Census to RDF 32000-naples-florida-businesses-kml -- 32000 Naples Florida Businesses in KML format aaoe-87 -- Airborne Antarctic Ozone Experiment (AAOE-87) acawiki -- AcaWiki Error: 403 [** For (lots) more information run with --debug **] DEBUG:dpm.cli:Exception: Traceback (most recent call last): File "/home/dgraziotin/Projects/dpm/dpm/cli/base.py", line 172, in main self.run(options, args) File "/home/dgraziotin/Projects/dpm/dpm/cli/standard.py", line 90, in run for pkg in index.search(query): File "/home/dgraziotin/Projects/dpm/dpm/index/ckan.py", line 52, in search yield self.get(pkg_name) File "/home/dgraziotin/Projects/dpm/dpm/index/ckan.py", line 67, in get self.ckan.package_entity_get(name) File "/usr/local/lib/python2.7/dist-packages/ckanclient-0.9-py2.7.egg/ckanclient/__init__.py", line 381, in package_entity_get self.open_url(url, headers=headers) File "/usr/local/lib/python2.7/dist-packages/ckanclient-0.9-py2.7.egg/ckanclient/__init__.py", line 344, in open_url raise CkanApiNotAuthorizedError(self.last_status) CkanApiNotAuthorizedError: 403
I tried this one with and without my API key, same results.
The same happens with the lib (same result with dpm.lib.search("ckan://",None))
In [4]: dpm.lib.search("ckan://","") Out[4]: list of 5objects (damn you, github markup)
CkanApiNotAuthorizedError is suppressed in the library for the moment
WORKSFORME (dpm search ckan:// keeps sending over datasets even without an API key).
Now it is working for me, too.
Not needed and covered by search