[Zope-Checkins] SVN: Zope/trunk/lib/python/reStructuredText/tests/testReST.py some more tests for csv-table directive

2006-07-29 Thread Andreas Jung
Log message for revision 69287:
  some more tests for csv-table directive
  

Changed:
  U   Zope/trunk/lib/python/reStructuredText/tests/testReST.py

-=-
Modified: Zope/trunk/lib/python/reStructuredText/tests/testReST.py
===
--- Zope/trunk/lib/python/reStructuredText/tests/testReST.py2006-07-28 
19:14:25 UTC (rev 69286)
+++ Zope/trunk/lib/python/reStructuredText/tests/testReST.py2006-07-29 
12:29:16 UTC (rev 69287)
@@ -108,6 +108,20 @@
 source = '.. raw:: html\n  :url: http://www.zope.org'
 self.assertRaises(NotImplementedError, HTML, source)
 
+
+def test_csv_table_file_option_raise(self):
+
+source = '.. csv-table:: \n  :file: inclusion.txt'
+result = HTML(source)
+self.failUnless('File and URL access deactivated' in result)
+
+def test_csv_table_file_option_raise(self):
+
+source = '.. csv-table:: \n  :url: http://www.evil.org'
+result = HTML(source)
+self.failUnless('File and URL access deactivated' in result)
+
+
 def test_suite():
 from unittest import TestSuite, makeSuite
 return TestSuite((makeSuite(TestReST),))

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py more tests for csv-table directive

2006-07-29 Thread Andreas Jung
Log message for revision 69288:
  more tests for csv-table directive
  

Changed:
  U   Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py

-=-
Modified: Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py
===
--- Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py2006-07-29 
12:29:16 UTC (rev 69287)
+++ Zope/trunk/lib/python/Products/ZReST/tests/test_ZReST.py2006-07-29 
12:42:49 UTC (rev 69288)
@@ -5,6 +5,7 @@
 $Id$
 
 import unittest
+import tempfile
 
 txt = Hello World
 
@@ -20,6 +21,11 @@
 
 
 
+
+csv_text = bin:x:1:1:bin:/bin:/bin/bash
+daemon:x:2:2:Daemon:/sbin:/bin/bash
+
+
 class TestZReST(unittest.TestCase):
 
 def _getTargetClass(self):
@@ -29,6 +35,11 @@
 def _makeOne(self, id='test', *args, **kw):
 return self._getTargetClass()(id=id, *args, **kw)
 
+def _csvfile(self):
+fn = tempfile.mktemp()
+open(fn, 'w').write(csv_text)
+return fn
+
 def test_empty(self):
 empty = self._makeOne()
 
@@ -91,6 +102,24 @@
 self.assertRaises(NotImplementedError, resty.render)
 
 
+def test_csv_table_file_option_raise(self):
+
+resty = self._makeOne()
+csv_file = self._csvfile()
+resty.source = '.. csv-table:: \n  :file: %s' % csv_file
+result = resty.render()
+self.failUnless('daemon' not in result, 
+'csv-table/file directive is not disabled!')
+
+def test_csv_table_url_option_raise(self):
+resty = self._makeOne()
+csv_file = self._csvfile()
+resty.source = '.. csv-table:: \n  :url: file://%s' % csv_file
+result = resty.render()
+self.failUnless('daemon' not in result, 
+'csv-table/url directive is not disabled!')
+
+
 def test_suite():
 suite = unittest.TestSuite()
 suite.addTest(unittest.makeSuite(TestZReST))

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/reStructuredText/tests/testReST.py fixed nameclash

2006-07-29 Thread Andreas Jung
Log message for revision 69289:
  fixed nameclash
  

Changed:
  U   Zope/trunk/lib/python/reStructuredText/tests/testReST.py

-=-
Modified: Zope/trunk/lib/python/reStructuredText/tests/testReST.py
===
--- Zope/trunk/lib/python/reStructuredText/tests/testReST.py2006-07-29 
12:42:49 UTC (rev 69288)
+++ Zope/trunk/lib/python/reStructuredText/tests/testReST.py2006-07-29 
12:55:25 UTC (rev 69289)
@@ -115,7 +115,7 @@
 result = HTML(source)
 self.failUnless('File and URL access deactivated' in result)
 
-def test_csv_table_file_option_raise(self):
+def test_csv_table_url_option_raise(self):
 
 source = '.. csv-table:: \n  :url: http://www.evil.org'
 result = HTML(source)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/ more tests for csv-table directive

2006-07-29 Thread Andreas Jung
Log message for revision 69290:
  more tests for csv-table directive
  

Changed:
  U   Zope/branches/2.9/lib/python/Products/ZReST/tests/test_ZReST.py
  U   Zope/branches/2.9/lib/python/reStructuredText/tests/testReST.py

-=-
Modified: Zope/branches/2.9/lib/python/Products/ZReST/tests/test_ZReST.py
===
--- Zope/branches/2.9/lib/python/Products/ZReST/tests/test_ZReST.py 
2006-07-29 12:55:25 UTC (rev 69289)
+++ Zope/branches/2.9/lib/python/Products/ZReST/tests/test_ZReST.py 
2006-07-29 12:59:31 UTC (rev 69290)
@@ -3,7 +3,13 @@
 $Id$
 
 import unittest
+import tempfile
 
+
+csv_text = bin:x:1:1:bin:/bin:/bin/bash
+daemon:x:2:2:Daemon:/sbin:/bin/bash
+
+
 class TestZReST(unittest.TestCase):
 
 def _getTargetClass(self):
@@ -13,6 +19,11 @@
 def _makeOne(self, id='test', *args, **kw):
 return self._getTargetClass()(id=id, *args, **kw)
 
+def _csvfile(self):
+fn = tempfile.mktemp()
+open(fn, 'w').write(csv_text)
+return fn
+
 def test_empty(self):
 empty = self._makeOne()
 
@@ -59,6 +70,24 @@
 resty.source = '.. raw:: html\n  :url: http://www.zope.org/'
 self.assertRaises(NotImplementedError, resty.render)
 
+def test_csv_table_file_option_raise(self):
+
+resty = self._makeOne()
+csv_file = self._csvfile()
+resty.source = '.. csv-table:: \n  :file: %s' % csv_file
+result = resty.render()
+self.failUnless('daemon' not in result, 
+'csv-table/file directive is not disabled!')
+
+def test_csv_table_url_option_raise(self):
+resty = self._makeOne()
+csv_file = self._csvfile()
+resty.source = '.. csv-table:: \n  :url: file://%s' % csv_file
+result = resty.render()
+self.failUnless('daemon' not in result, 
+'csv-table/url directive is not disabled!')
+
+
 def test_suite():
 suite = unittest.TestSuite()
 suite.addTest(unittest.makeSuite(TestZReST))

Modified: Zope/branches/2.9/lib/python/reStructuredText/tests/testReST.py
===
--- Zope/branches/2.9/lib/python/reStructuredText/tests/testReST.py 
2006-07-29 12:55:25 UTC (rev 69289)
+++ Zope/branches/2.9/lib/python/reStructuredText/tests/testReST.py 
2006-07-29 12:59:31 UTC (rev 69290)
@@ -52,6 +52,18 @@
 source = '.. raw:: html\n  :url: http://www.zope.org'
 self.assertRaises(NotImplementedError, HTML, source)
 
+def test_csv_table_file_option_raise(self):
+
+source = '.. csv-table:: \n  :file: inclusion.txt'
+result = HTML(source)
+self.failUnless('directive disabled' in result)
+
+def test_csv_table_url_option_raise(self):
+
+source = '.. csv-table:: \n  :url: http://www.evil.org'
+result = HTML(source)
+self.failUnless('directive disabled' in result)
+
 def test_suite():
 from unittest import TestSuite, makeSuite
 return TestSuite((makeSuite(TestReST),))

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/reStructuredText/tests/testReST.py more tests for csv-table directive

2006-07-29 Thread Andreas Jung
Log message for revision 69291:
  more tests for csv-table directive
  

Changed:
  U   Zope/branches/2.10/lib/python/reStructuredText/tests/testReST.py

-=-
Modified: Zope/branches/2.10/lib/python/reStructuredText/tests/testReST.py
===
--- Zope/branches/2.10/lib/python/reStructuredText/tests/testReST.py
2006-07-29 12:59:31 UTC (rev 69290)
+++ Zope/branches/2.10/lib/python/reStructuredText/tests/testReST.py
2006-07-29 13:34:59 UTC (rev 69291)
@@ -108,6 +108,20 @@
 source = '.. raw:: html\n  :url: http://www.zope.org'
 self.assertRaises(NotImplementedError, HTML, source)
 
+
+def test_csv_table_file_option_raise(self):
+
+source = '.. csv-table:: \n  :file: inclusion.txt'
+result = HTML(source)
+self.failUnless('File and URL access deactivated' in result)
+
+def test_csv_table_file_option_raise(self):
+
+source = '.. csv-table:: \n  :url: http://www.evil.org'
+result = HTML(source)
+self.failUnless('File and URL access deactivated' in result)
+
+
 def test_suite():
 from unittest import TestSuite, makeSuite
 return TestSuite((makeSuite(TestReST),))

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/ZReST/tests/test_ZReST.py more tests for csv-table directive

2006-07-29 Thread Andreas Jung
Log message for revision 69292:
  more tests for csv-table directive
  

Changed:
  U   Zope/branches/2.10/lib/python/Products/ZReST/tests/test_ZReST.py

-=-
Modified: Zope/branches/2.10/lib/python/Products/ZReST/tests/test_ZReST.py
===
--- Zope/branches/2.10/lib/python/Products/ZReST/tests/test_ZReST.py
2006-07-29 13:34:59 UTC (rev 69291)
+++ Zope/branches/2.10/lib/python/Products/ZReST/tests/test_ZReST.py
2006-07-29 13:35:45 UTC (rev 69292)
@@ -5,6 +5,7 @@
 $Id$
 
 import unittest
+import tempfile
 
 txt = Hello World
 
@@ -20,6 +21,11 @@
 
 
 
+
+csv_text = bin:x:1:1:bin:/bin:/bin/bash
+daemon:x:2:2:Daemon:/sbin:/bin/bash
+
+
 class TestZReST(unittest.TestCase):
 
 def _getTargetClass(self):
@@ -29,6 +35,11 @@
 def _makeOne(self, id='test', *args, **kw):
 return self._getTargetClass()(id=id, *args, **kw)
 
+def _csvfile(self):
+fn = tempfile.mktemp()
+open(fn, 'w').write(csv_text)
+return fn
+
 def test_empty(self):
 empty = self._makeOne()
 
@@ -91,6 +102,24 @@
 self.assertRaises(NotImplementedError, resty.render)
 
 
+def test_csv_table_file_option_raise(self):
+
+resty = self._makeOne()
+csv_file = self._csvfile()
+resty.source = '.. csv-table:: \n  :file: %s' % csv_file
+result = resty.render()
+self.failUnless('daemon' not in result, 
+'csv-table/file directive is not disabled!')
+
+def test_csv_table_url_option_raise(self):
+resty = self._makeOne()
+csv_file = self._csvfile()
+resty.source = '.. csv-table:: \n  :url: file://%s' % csv_file
+result = resty.render()
+self.failUnless('daemon' not in result, 
+'csv-table/url directive is not disabled!')
+
+
 def test_suite():
 suite = unittest.TestSuite()
 suite.addTest(unittest.makeSuite(TestZReST))

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-Checkins] Re: [Checkins] SVN: Products.Five/trunk/ Now you can use the old registry with the new API for registerig components.

2006-07-29 Thread Jean-Marc Orliaguet

Florent Guillaume wrote:

Indeed :)


On 29 Jul 2006, at 00:39, Benji York wrote:


Florent Guillaume wrote:

On 27 Jul 2006, at 16:15, Lennart Regebro wrote:

Modified: Products.Five/trunk/site/localsite.py
===
--- Products.Five/trunk/site/localsite.py2006-07-27 13:51:25 
UTC  (rev 69270)
+++ Products.Five/trunk/site/localsite.py2006-07-27 14:15:46 
UTC  (rev 69271)

@@ -16,12 +16,26 @@
$Id$


+from operator import xor
+def one_of_three(a, b, c):
+# Logical table for a three part test where only one can be true:
+# 0 0 0: 0
+# 0 0 1: 1
+# 0 1 0: 1
+# 0 1 1: 0
+# 1 0 0: 1
+# 1 0 1: 0
+# 1 1 0: 0
+# 1 1 1: 0
+return xor(xor(a, b), c) and not (a and b and c)
Heh, boolean algebra is nice but sometimes integers convey the  
meaning much better:

   return int(a)+int(b)+int(c) == 1


Hey, this is fun!  How about this:

def only_one(*args):
return sum(bool(i) for i in args) == 1
--Benji York
Senior Software Engineer
Zope Corporation




or even:

[a, b, c].count(True) == 1

:-)
/JM

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] buildbot failure in Zope branches 2.9 2.4 Windows 2000 zc-bbwin2

2006-07-29 Thread buildbot
The Buildbot has detected a failed build of Zope branches 2.9 2.4 Windows 2000 
zc-bbwin2.

Buildbot URL: http://buildbot.zope.org/

Build Reason: changes
Build Source Stamp: 6781
Blamelist: andreasjung,benji_york,dominikhuber,hdima,poster,tseaver

BUILD FAILED: failed compile

sincerely,
 -The Buildbot

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-PAS] PAS Caching (sucks)

2006-07-29 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Even though I am the perpetrator, I think the current way of caching,  
using ZCacheable and RAM cache managers, is absolutely horrific. It's  
cumbersome to set up and the ZCacheable API is ugly as sin using it  
from code. I think simplification is needed.


I personally don't see any need to have caching in plugins  
themselves. Instead, caching should be applied at the gateway into  
the user folder, where it emits user objects. These user objects  
should be cached as a whole. I am envisioning a thread-independent  
cache (meaning no redundant lookups in each thread) that is  
configured using a caching ZMI tab on the PAS instance. No more Cache  
tab everywhere and no more RAM cache managers to configure. And no  
more contortions in plugin code to utilize ZCacheable.


This model is the exact same model used in the LDAPUserFolder itself.  
The caching mechanism in the LDAPUserFolder contains two thread- 
independent bags where unwrapped users are stored: One exclusively  
for user objects generated from passwordless lookups, such as calls  
to getUser or getUserById and friends, and those generated by lookups  
that provide passwords. In this particular application having two  
user caches is simply an artifact of my slight abuse of getUser, so  
it might end up different in PAS.


Who's got an opinion?

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEy3CIRAx5nvEhZLIRArwVAJ9V4hJ6dR4B7CE7p7E/v56oaolL+QCfX3OQ
yJmjbx2cNCSp2KFBEMTveLo=
=meix
-END PGP SIGNATURE-
___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


Re: Re: [Zope] how to use chinese character in zope 2.8.7

2006-07-29 Thread KE Liew

= = = = = = = = = = = = = = = = = = = =
i followed you but have no effect.

and  i find a fact that  chinese character in zope not work  but it in 
plone on same zope work well.

what reasons?

do you have another method?


Can you please check your Apache configuration on whether UTF-8 is
enabled. Possibly FC5 needs to be enabled for UTF-8.


Regards,

Kwang
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Newbie: Missing a Variable (TAL/METAL Question)

2006-07-29 Thread Dieter Maurer
beno - wrote at 2006-7-28 15:43 -0700:
 ...
  tr tal:repeat=item batch
td tal:define=number repeat/item/number
tal:content=number1/td
td tal:content=item/titletitle/td
tdtal:content 
 metal:use-macro=here/?number/macros/authorauthor/tal:content/td
 ...
 Traceback
 ...
 Line 22, Column 4
 Expression: standard:'here/?number/macros/author'
 ...
KeyError: 'number' (Also, an error occurred while attempting to render the 
standard error message.)

The traceback tells you (kept part) that the KeyError: 'number' comes
from here/?number/macros/author and it is right:

   Unless you use global, variables defined in TAL only live
   within the element (aka tag) you have defined them in.

   In your special case, this is the td element.
   It it not defined in the following tds.

A common approach is to use artificial block elements to
carry the definitions for some elements in the loop body -- similar to

  tr tal:repeat=...
tal:block define=number ...
  td tal:content=number /
  ...
  tdtal:content metal:use-macro=here/?number/... //td
  ...
/tal:block
  /tr

Apparently, you already use tal prefixed tag names.
The tal:block is another standard use...


Another advice: carefully read the PageTemplate section in
the Zope Book (2.7 edition, on plope.org).



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Newbie: Missing a Variable (TAL/METAL Question)

2006-07-29 Thread beno -
Alexis Rhoda's suggestion sounds similar. I edited the code as follows, both with and without the 'global' parameter with the same error thrown. I read the material you recommended before writing the list and have been referencing it. I confess that snakes would bite me repeatedly though before my eyes for lack of seeing them, no matter how hard I try. Your further help would be very much appreciated. TIA,beno tr tal:repeat="item batch" tal:block define="global number repeat/item/number" td tal:content="number"1/td td tal:content="item/title"title/td tdtal:content metal:use-macro="here/?number/macros/author"author/tal:content/td tdtal:content metal:use-macro="here/?number/macros/content"content/tal:content/td td
 tal:content="item/bobobase_modification_time" modification date/td  /tal:block /tr3TypeErrorSorry, a site error occurred.Traceback (innermost last):   Module ZPublisher.Publish, line 175, in publish_module_standard  Module ZPublisher.Publish, line 132, in publish  Module Zope.App.startup, line 204, in zpublisher_exception_hook  Module ZPublisher.Publish, line 101, in publish  Module ZPublisher.mapply, line 88, in mapply  Module ZPublisher.Publish, line 39, in call_object  Module Shared.DC.Scripts.Bindings, line 306, in
 __call__  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec  Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec  Module Products.PageTemplates.PageTemplate, line 96, in pt_render ZopePageTemplate at /rejoice.2012.vi/en-us/Books/getQuote used for /rejoice.2012.vi/en-us/Books/test  Module TAL.TALInterpreter, line 190, in __call__  Module TAL.TALInterpreter, line 234, in interpret  Module TAL.TALInterpreter, line 613, in do_loop_tal  Module TAL.TALInterpreter, line 234, in interpret  Module TAL.TALInterpreter, line 409, in do_optTag_tal  Module TAL.TALInterpreter, line 394, in do_optTag  Module TAL.TALInterpreter, line 389, in no_tag  Module TAL.TALInterpreter, line 234, in interpret  Module TAL.TALInterpreter, line 657, in do_useMacro  Module Products.PageTemplates.TALES, line 221, in evaluate URL:
 /rejoice.2012.vi/en-us/Books/getQuote Line 22, Column 8 _expression_: standard:'here/?number/macros/author' Names:{'container': Folder instance at e909350, 'context': Folder instance at 92e1ad0, 'default': Products.PageTemplates.TALES.Default instance at 0x8a1d62c, 'here': Folder instance at 92e1ad0, 'loop': SafeMapping instance at 8ff2380, 'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x8a1d06c, 'nothing': None, 'options': {'args': ()}, 'repeat': SafeMapping instance at 8ff2380, 'request': HTTPRequest, URL=""> 'root': Application instance at 90c1f80, 'template': ZopePageTemplate at /rejoice.2012.vi/en-us/Books/getQuote used for /rejoice.2012.vi/en-us/Books/test, 'traverse_subpath': [], 'user': Anonymous
 User}  Module Products.PageTemplates.Expressions, line 174, in __call__  Module Products.PageTemplates.Expressions, line 162, in _eval  Module Products.PageTemplates.Expressions, line 107, in _evalTypeError: iteration over non-sequence (Also, an error occurred while attempting to render the standard error message.)Dieter Maurer [EMAIL PROTECTED] wrote: beno - wrote at 2006-7-28 15:43 -0700: ...  tal:content="number"1titleauthor ... Traceback ... Line 22, Column 4 _expression_: standard:'here/?number/macros/author' ...KeyError: 'number' (Also, an error
 occurred while attempting to render the standard error message.)The traceback tells you (kept part) that the "KeyError: 'number'" comesfrom "here/?number/macros/author" and it is right:   Unless you use "global", variables defined in TAL only live   within the element (aka "tag") you have defined them in.   In your special case, this is the "td" element.   It it not defined in the following "td"s.A common approach is to use artificial "block" elements tocarry the definitions for some elements in the loop body -- similar to...  ...   Apparently, you already use "tal" prefixed tag names.The "tal:block" is another standard use...Another advice: carefully read the PageTemplate section inthe Zope Book (2.7 edition, on "plope.org").--
 Dieter 
		Groups are talking. Were listening. Check out the handy changes to Yahoo! Groups. ___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Newbie: Missing a Variable (TAL/METAL Question)

2006-07-29 Thread Dieter Maurer
beno - wrote at 2006-7-29 10:09 -0700:
 ...
  tr tal:repeat=item batch
   tal:block define=global number repeat/item/number
td tal:content=number1/td
td tal:content=item/titletitle/td
tdtal:content 
 metal:use-macro=here/?number/macros/authorauthor/tal:content/td
tdtal:content 
 metal:use-macro=here/?number/macros/contentcontent/tal:content/td
td tal:content=item/bobobase_modification_time
  modification date/td  
   /tal:block
  /tr
 ...
Sorry, a site error occurred.Traceback (innermost last): 
 ...
 Line 22, Column 8
 Expression: standard:'here/?number/macros/author'
 ...
 Module Products.PageTemplates.Expressions, line 107, in _eval
TypeError: iteration over non-sequence (Also, an error occurred while 
attempting to render the standard error message.)

This one is a bit more difficult: you need to look at the source code
to find out what goes wrong.

The traceback again tells you that the problem is
with here/?number/macros/author.
Moreover, it tells you that the exception is raised in line 107
of Module Products.PageTemplates.Expressions.
The code, you see there is path[i:i+1] = list(val).

I see from this code (it is okay when you do not yet see it),
that list(val) is the problem.

You must now look a bit around and take names seriously.
The code aroung is:

if self._dp:
path = list(path) # Copy!
for i, varname in self._dp:
val = vars[varname]
if isinstance(val, StringType):
path[i] = val
else:
# If the value isn't a string, assume it's a sequence
# of path names.
path[i:i+1] = list(val)

This loop is responsible to replace the ?varname occurrencies in your
path by the value of the variable varname.

As you see, the value may either be a string or a sequence of paths.

In your case, it is an integer and list(some_integer) results
in the TypeError you observe.

Add number python:`number` after your definition of number, i.e.

tal:block define=number repeat/item/number; number python:`number`

I removed the global (as you no longer need it due to the introduction
of tal:block).

The `...` is a Python operator equivalent to
a call to repr(...) which converts into a string.




-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can't nest dtml-in using prefix ...

2006-07-29 Thread Dieter Maurer
Jesper Steen Steffensen wrote at 2006-7-28 22:27 +0200:
This won't work:

dtml-in qry_user_roles prefix=outer
  dtml-in qry_roles
  dtml-if expr=outer_role==role
Roles are matching
  /dtml-if
  /dtml-in
/dtml-in

I get an error that says key error - outer_role doesn't exist.
It doesn't matter if I prefix the inner dtml-in as well. (I've read it isn't
necessary though)
Why won't the prefix work for me?

The prefix affects only the sequence- variables (it replaces the
sequence- prefix by prefix_). It does not do anything with
the other (non sequence- prefixed) variables definied by the dtml-in.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Can't nest dtml-in using prefix ...

2006-07-29 Thread Jesper Steen Steffensen
The prefix affects only the sequence- variables (it replaces the
sequence- prefix by prefix_). It does not do anything withthe other (non sequence- prefixed) variables definied by the dtml-in.Dieter
@ Dieter - thanks for clearing that up. Maybe [sequence]-var-[variable] or rather outer-var-role will work then.. Will give it a try when I get back to work.I'll look into ZPT as well. Sounds promising.
Thanks all for helping me out here.Cheers
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to use chinese character in zope 2.8.7

2006-07-29 Thread Tino Wildenhain
Chris Withers wrote:
 Mark Barratt wrote:
 2: In the root of the Zope Management Interface, choose the properties
 tab. In it, add a new property called MANAGEMENT_PAGE_CHARSET of type
 'string' with value utf-8.
 
 Actually, for hysterical raisins, this needs to be UTF-8 rather than
 utf-8 in order for the unicode property types to make themselves apparent.
 
 Aside from this, use unicode for everything...


Btw, still waiting for comments, thumbs down/up for:

http://www.zope.org/Collectors/Zope/2148

cheers
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to use chinese character in zope 2.8.7

2006-07-29 Thread Mark Barratt
Tino Wildenhain wrote:

 Btw, still waiting for comments, thumbs down/up for:
 
 http://www.zope.org/Collectors/Zope/2148

you have my +1 recorded. Setting the management_page_charset property is
an obscure and ill-documented fix for a common problem, which cost me a
lot of bafflement and time to resolve.

-- 
Mark Barratt
Text Matters

Information design: we help explain things using
language | design | systems | process improvement
__
phone +44 (0)118 986 8313  email [EMAIL PROTECTED]
skype mark_barratt  web http://www.textmatters.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )