No subject
Sun Dec 12 18:29:16 UTC 2010
metastable version of ckanclient - which one are you using and can you
try the latest? Also worth checking what version of ckan you're on.
I suggest that in the line before it stops in ckanclient/__init__.py
you put a print self.last_body and self.last_headers and see where the
content-type header is getting to. Do let us know how this goes.
David
On 16 December 2010 15:43, Scheel, Thomas
<thomas.scheel at fokus.fraunhofer.de> wrote:
> Hello *,
>
> first thanks for the help with the data import from spreadsheets.
> I made a customized import script which inherits from =
SimpleGoogleSpreadsheetLoader.
> When I run the script (with =
--ckan-api-location=3Dhttp://127.0.0.1:5000/api --ckan-api-key=3Dxxx =
--google-spreadsheet-key=3Dxxx --google-email=3Dxxx =
--google-password=3Dxxx)
> It reads the fields of the spreadsheet an exits with:
>
> Reading Google spreadsheet. Please wait...
> Working area of spreadsheet: top-left (1, 1); bottom-right (6, 10).
> There are 10 headings: unique_id, title, tags, notes, url, =
resources-0-url, resource-0-format, author, maintainer, license
> There are 3 entities: amt far statistik berlin-brandenburg, =
bundesgesetztracker, auslanderstatistik
> There are 3 metadata packages with titles extracted from the =
spreadsheet.
> Putting 3 packages on CKAN running at http://127.0.0.1:5000/api
>
> Traceback (most recent call last):
> =A0File "/home/ckanuser/ckanext/bin/ckanload-aidprojdata", line 29, in =
<module>
> =A0 =A0AidProjectsLoader().run()
> =A0File =
"/home/ckan-user/pyenv/src/ckanclient/ckanclient/loaders/base.py", line =
105, in run
> =A0 =A0self.put_packages_on_ckan()
> =A0File =
"/home/ckanuser/pyenv/src/ckanclient/ckanclient/loaders/base.py", line =
121, in put_packages_on_ckan
> =A0 =A0registered_package =3D =
self.ckanclient.package_entity_get(package['name'])
> =A0File "/home/ckanuser/pyenv/src/ckanclient/ckanclient/__init__.py", =
line 322, in package_entity_get
> =A0 =A0self.open_url(url)
> =A0File "/home/ckanuser/pyenv/src/ckanclient/ckanclient/__init__.py", =
line 288, in open_url
> =A0 =A0result =3D super(CkanClient, self).open_url(url, *args, =
**kwargs)
> =A0File "/home/ckanuser/pyenv/src/ckanclient/ckanclient/__init__.py", =
line 189, in open_url
> =A0 =A0content_type =3D self.last_headers['Content-Type']
> =A0File "/usr/lib/python2.6/rfc822.py", line 388, in __getitem__
> =A0 =A0return self.dict[name.lower()]
> KeyError: 'content-type'
>
> Does anybody know what the problem is? For me, it is very strange, =
bacause the script works fine for several imports and I already load =
some data in the database. Now it seems that the request doesn't arrive =
at the server side.
>
> As python rookie I would be very thankful for any useful hint.
>
> Many thanks in advance
>
> Thomas Scheel
>
> -----Urspr=FCngliche Nachricht-----
> Von: friedrich.lindenberg at gmail.com =
[mailto:friedrich.lindenberg at gmail.com] Im Auftrag von Friedrich =
Lindenberg
> Gesendet: Donnerstag, 9. Dezember 2010 12:07
> An: rufus.pollock at okfn.org; CKAN Development Discussions
> Cc: Scheel, Thomas
> Betreff: Re: [ckan-dev] problem with package importer
>
> Hi Thomas,
>
> On Thu, Dec 9, 2010 at 10:35 AM, Rufus Pollock =
<rufus.pollock at okfn.org> wrote:
>>> Another thing I noticed, if I'm downloading a data package via =
datapkg
>>> download ckan://iso-3166-2-data . like the example in the manual, it =
is
>>> working fine. But when I try to download other packages, especially =
in the
>>> german ckan version (de.ckan.org) I always get exceptions while =
reading
>>> information (datapkg info) or downloading the package. Is the german =
version
>>> incompatible to datapkg or strikes the download while reading faulty =
or
>>> incomplete records?
>>
>> How are you trying to search offenedaten.de. At the moment (we are
>> changing this as more CKAN instances appear) you will have to set
>> ckan.url in your [index:ckan] section to:
>>
>> ckan.url =3D http://offenedaten.de
>>
>> I was then able to successfully query e.g.:
>>
>> $ datapkg search ckan:// statistik
>> $ datapkg info ckan://destatis-statistik-21411
>> $ datapkg download ckan://destatis-statistik-21411 .
>> # there will now be a /tmp/destatis-statistik-21411 directory
>>
>> I note many offenedaten.de packages have no download resources in
>> which case datapkg download will exit silently and do nothing. This
>> should probably be made more apparent (many offenedaten packages have
>> no download resources at the moment!).
>
> It is also worth noting that offenedaten/de.ckan is based on an
> outdated and somewhat unstable version CKAN. Daniel and I should
> invest some time into upgrading this while keeping plugins and theming
> intact.
>
> Also: why is it that datapkg will only download the first listed
> resource, is there anything speaking against an "--all" switch?
>
> - Friedrich
>
>
>>
>> One way to see this is to run in verbose mode:
>>
>> datapkg download --verbose ... ...
>>
>> Rufus
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org
http://lists.okfn.org/mailman/listinfo/ckan-dev
More information about the ckan-dev
mailing list