[Zope] Re: More product writing problems

Tille, Andreas TilleA@rki.de
Tue, 4 Dec 2001 18:14:32 +0100 (CET)


On Tue, 4 Dec 2001, Seb Bacon wrote:

> You need to get Zope to use the 2.1 libraries as well as the 2.1 binary.
> Make a symlink from Zope/lib/python-2.1 to <python>/lib/python-2.1.
Well, this worked so far with exception of a whole bunch of warnings at
restart:

WARNING: Python C API version mismatch for module _OIBTree:
This Python has API version 1010, module _OIBTree has version 1007.

for several different modules as well as _OIBTree.  But this is
another problem which I have to sort out.  The problem is that I
seem to missunderstood the 'type' of my keywords variable:


    ob=MyFolder()
    ob.id=str(id)
    ob.title=title
    ob.keywords={}
    for kw in keywords:
        kw=kw.strip()
        if kw != '' :
            ob.keywords.append(kw)
    self._setObject(id, ob)
    ob=self._getOb(id)

now has the following problem:

Import Traceback

Traceback (most recent call last):
  File "/usr/lib/zope/lib/python/OFS/Application.py", line 528, in import_products
    product=__import__(pname, global_dict, global_dict, silly)
  File "/usr/lib/zope/lib/python/Products/MyFolder/__init__.py", line 1, in ?
    from MyFolder import MyFolder, manage_addMyFolderForm, manage_addMyFolder
  File "/usr/lib/zope/lib/python/Products/MyFolder/MyFolder.py", line 63
     ob.keywords.append() = kw
 SyntaxError: can't assign to function call

My 'keywords' variable is a set of lines and I want to store each
single line as one keyword.  Does anybody know how to do that.

Sorry, I'm a bloody Python beginner.

Kind regards

         Andreas.