[Zope-CMF] Re: How to translate CMF, first summary

Tille, Andreas TilleA@rki.de
Thu, 27 Sep 2001 16:44:08 +0200 (CEST)


On Thu, 27 Sep 2001, Jens Vagelpohl wrote:

> yes, something is probably wrong. make sure that your setup is really
> running off the set of files you are looking at.
Yes, there seems to be something wrong ...

I found a tool in my Debian GNU/Linux setup which byte-compiles all .py =
files
in a given directory.  I did so and detected the following:

#  python2 /usr/lib/python1.5/compileall.py =
/usr/lib/zope/lib/python/Products/CMFDefault/skins/content
Byte-compiling new files in =
/usr/lib/zope/lib/python/Products/CMFDefault/skins/content ...
Listing /usr/lib/zope/lib/python/Products/CMFDefault/skins/content ...
Compiling =
/usr/lib/zope/lib/python/Products/CMFDefault/skins/content/aboveInThread=
.py ...
SyntaxError: 'return' outside function (aboveInThread.py, line 16)
Compiling =
/usr/lib/zope/lib/python/Products/CMFDefault/skins/content/metadata_edit=
.py ...
SyntaxError: 'return' outside function (metadata_edit.py, line 66)

This are files from the package  zope-cmfdefault_1.1-4.deb i.e. CMF 1.1
distribution.  Before I do a bug-report against the Debian package =
I=B4d
like to ask here whether somebody else has the same problem.

Because it is a short file I include the file
  =
/usr/lib/zope/lib/python/Products/CMFDefault/skins/content/aboveInThread=
.py:

 1 ## Script (Python) "aboveInThread"
 2 ##parameters=3D
 3 ##title=3DDiscussion parent breadcrumbs
 4
 5 breadcrumbs =3D ''
 6 parents =3D context.parentsInThread()
 7
 8 if parents:
 9     breadcrumbs =3D 'Above in thread: '
10     for parent in parents:
11         p_str =3D '<a href=3D"%s">%s</a>' % (parent.absolute_url(), =
parent.Title())
12         breadcrumbs =3D breadcrumbs + p_str + ':'
13
14     breadcrumbs =3D breadcrumbs[:-1] + '<p>'
15
16 return breadcrumbs
17

I=B4m a real python beginner and I do not understand the problem.  But
obviousely it is the same for the file menuTranslator.py cmf-int which
made my trouble in the beginning.

Any suggestion, how to fix that?

Kind regards

        Andreas.