[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/ Collector #1926: add tests for both not-yet-encrypted and pre-encrypted passwords handed to '_doAddUser'.

2005-10-21 Thread Tres Seaver
Log message for revision 39545:
  Collector #1926:  add tests for both not-yet-encrypted and pre-encrypted 
passwords handed to '_doAddUser'.

Changed:
  U   
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testUserFolder.py
  U   Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/ZReST.py
  A   Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/
  A   Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/__init__.py
  A   
Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/test_ZReST.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testUserFolder.py
===
--- 
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testUserFolder.py  
2005-10-21 02:03:49 UTC (rev 39544)
+++ 
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testUserFolder.py  
2005-10-21 06:50:48 UTC (rev 39545)
@@ -206,7 +206,39 @@
 except OverflowError:
 assert 0, Raised overflow error erroneously
 
+def test__doAddUser_with_not_yet_encrypted_passwords(self):
+# See collector #1869  #1926
+from AccessControl.AuthEncoding import pw_validate
 
+USER_ID = 'not_yet_encrypted'
+PASSWORD = 'password'
+
+uf = UserFolder().__of__(self.app)
+uf.encrypt_passwords = True
+self.failIf(uf._isPasswordEncrypted(PASSWORD))
+
+uf._doAddUser(USER_ID, PASSWORD, [], [])
+user = uf.getUserById(USER_ID)
+self.failUnless(uf._isPasswordEncrypted(user.__))
+self.failUnless(pw_validate(user.__, PASSWORD))
+
+def test__doAddUser_with_preencrypted_passwords(self):
+# See collector #1869  #1926
+from AccessControl.AuthEncoding import pw_validate
+
+USER_ID = 'already_encrypted'
+PASSWORD = 'password'
+
+uf = UserFolder().__of__(self.app)
+uf.encrypt_passwords = True
+ENCRYPTED = uf._encryptPassword(PASSWORD)
+
+uf._doAddUser(USER_ID, ENCRYPTED, [], [])
+user = uf.getUserById(USER_ID)
+self.assertEqual(user.__, ENCRYPTED)
+self.failUnless(uf._isPasswordEncrypted(user.__))
+self.failUnless(pw_validate(user.__, PASSWORD))
+
 class UserTests(unittest.TestCase):
 
 def testGetUserName(self):

Modified: Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/ZReST.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/ZReST.py
2005-10-21 02:03:49 UTC (rev 39544)
+++ Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/ZReST.py
2005-10-21 06:50:48 UTC (rev 39545)
@@ -47,6 +47,7 @@
 '''
 meta_type =  'ReStructuredText Document'
 security = ClassSecurityInfo()
+_v_formatted = _v_warnings = None
 
 def __init__(self, id,output_encoding=None,
  input_encoding=None):
@@ -54,7 +55,7 @@
 self.title = id
 self.stylesheet = 'default.css'
 self.report_level = '2'
-self.source = self.formatted = ''
+self.source = ''
 
 from reStructuredText import default_output_encoding, \
  default_input_encoding
@@ -89,7 +90,7 @@
 '''
 if REQUEST is not None:
 REQUEST.RESPONSE.setHeader('content-type', 'text/html; charset=%s' 
% self.output_encoding)
-return self.formatted
+return self.render()
 
 security.declareProtected('View', 'source_txt')
 def source_txt(self, REQUEST=None):
@@ -113,7 +114,7 @@
 return self._er(data, SUBMIT, dtpref_cols, dtpref_rows, REQUEST)
 if data != self.source:
 self.source = data
-self.render()
+self._clear_cache()
 
 if REQUEST is not None:
 message=Saved changes.
@@ -142,6 +143,7 @@
 setCookie(dtpref_cols, cols, path='/', expires=e)
 REQUEST.other.update({dtpref_cols:cols, dtpref_rows:rows})
 return self.manage_main(self, REQUEST, __str__=self.quotedHTML(data))
+
 security.declarePrivate('quotedHTML')
 def quotedHTML(self,
text=None,
@@ -155,6 +157,18 @@
 if text.find(re) = 0: text=name.join(text.split(re))
 return text
 
+security.declarePrivate('_clear_cache')
+def _clear_cache(self):
+ Forget results of rendering.
+
+try:
+del self._v_formatted
+except AttributeError:
+pass
+try:
+del self._v_warnings
+except AttributeError:
+pass
 
 # handle uploads too
 security.declareProtected('Edit ReStructuredText', 'manage_upload')
@@ -165,7 +179,7 @@
 self.source = file
 else:
 self.source = file.read()
-self.render()
+self._clear_cache()
 
 if REQUEST is not None:
 message=Saved changes.
@@ -175,57 +189,60 @@
   

[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py Forward-port tests for collector #1926 from 2.8 branch.

2005-10-21 Thread Tres Seaver
Log message for revision 39547:
  Forward-port tests for collector #1926 from 2.8 branch.

Changed:
  U   Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py
===
--- Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py 2005-10-21 
06:56:48 UTC (rev 39546)
+++ Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py 2005-10-21 
06:59:12 UTC (rev 39547)
@@ -206,7 +206,39 @@
 except OverflowError:
 assert 0, Raised overflow error erroneously
 
+def test__doAddUser_with_not_yet_encrypted_passwords(self):
+# See collector #1869  #1926
+from AccessControl.AuthEncoding import pw_validate
 
+USER_ID = 'not_yet_encrypted'
+PASSWORD = 'password'
+
+uf = UserFolder().__of__(self.app)
+uf.encrypt_passwords = True
+self.failIf(uf._isPasswordEncrypted(PASSWORD))
+
+uf._doAddUser(USER_ID, PASSWORD, [], [])
+user = uf.getUserById(USER_ID)
+self.failUnless(uf._isPasswordEncrypted(user.__))
+self.failUnless(pw_validate(user.__, PASSWORD))
+
+def test__doAddUser_with_preencrypted_passwords(self):
+# See collector #1869  #1926
+from AccessControl.AuthEncoding import pw_validate
+
+USER_ID = 'already_encrypted'
+PASSWORD = 'password'
+
+uf = UserFolder().__of__(self.app)
+uf.encrypt_passwords = True
+ENCRYPTED = uf._encryptPassword(PASSWORD)
+
+uf._doAddUser(USER_ID, ENCRYPTED, [], [])
+user = uf.getUserById(USER_ID)
+self.assertEqual(user.__, ENCRYPTED)
+self.failUnless(uf._isPasswordEncrypted(user.__))
+self.failUnless(pw_validate(user.__, PASSWORD))
+
 class UserTests(unittest.TestCase):
 
 def testGetUserName(self):

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


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Collector #1927: Don't save rendered HTML / warnings as persistent attributes.

2005-10-21 Thread Tres Seaver
Log message for revision 39550:
  Collector #1927:  Don't save rendered HTML / warnings as persistent 
attributes.

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/ZReST.py
  A   Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/
  A   Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/__init__.py
  A   
Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/test_ZReST.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-10-21 13:31:50 UTC 
(rev 39549)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-10-21 17:30:25 UTC 
(rev 39550)
@@ -26,6 +26,10 @@
 
 Bugs Fixed
 
+  - Collector #1927:  Modified ZReST not to store rendered / warnings
+as persistent attributes, using volatile attributes instead as
+a cache.
+
   - Collector #1926: fixed a typo in _doAddUser when password
 encryption is enabled.
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/ZReST.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/ZReST.py
2005-10-21 13:31:50 UTC (rev 39549)
+++ Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/ZReST.py
2005-10-21 17:30:25 UTC (rev 39550)
@@ -47,6 +47,7 @@
 '''
 meta_type =  'ReStructuredText Document'
 security = ClassSecurityInfo()
+_v_formatted = _v_warnings = None
 
 def __init__(self, id,output_encoding=None,
  input_encoding=None):
@@ -54,7 +55,7 @@
 self.title = id
 self.stylesheet = 'default.css'
 self.report_level = '2'
-self.source = self.formatted = ''
+self.source = ''
 
 from reStructuredText import default_output_encoding, \
  default_input_encoding
@@ -89,7 +90,7 @@
 '''
 if REQUEST is not None:
 REQUEST.RESPONSE.setHeader('content-type', 'text/html; charset=%s' 
% self.output_encoding)
-return self.formatted
+return self.render()
 
 security.declareProtected('View', 'source_txt')
 def source_txt(self, REQUEST=None):
@@ -113,7 +114,7 @@
 return self._er(data, SUBMIT, dtpref_cols, dtpref_rows, REQUEST)
 if data != self.source:
 self.source = data
-self.render()
+self._clear_cache()
 
 if REQUEST is not None:
 message=Saved changes.
@@ -142,6 +143,7 @@
 setCookie(dtpref_cols, cols, path='/', expires=e)
 REQUEST.other.update({dtpref_cols:cols, dtpref_rows:rows})
 return self.manage_main(self, REQUEST, __str__=self.quotedHTML(data))
+
 security.declarePrivate('quotedHTML')
 def quotedHTML(self,
text=None,
@@ -155,6 +157,18 @@
 if text.find(re) = 0: text=name.join(text.split(re))
 return text
 
+security.declarePrivate('_clear_cache')
+def _clear_cache(self):
+ Forget results of rendering.
+
+try:
+del self._v_formatted
+except AttributeError:
+pass
+try:
+del self._v_warnings
+except AttributeError:
+pass
 
 # handle uploads too
 security.declareProtected('Edit ReStructuredText', 'manage_upload')
@@ -165,7 +179,7 @@
 self.source = file
 else:
 self.source = file.read()
-self.render()
+self._clear_cache()
 
 if REQUEST is not None:
 message=Saved changes.
@@ -175,57 +189,60 @@
 def render(self):
 ''' Render the source to HTML
 '''
-# format with strings
-pub = docutils.core.Publisher()
-pub.set_reader('standalone', None, 'restructuredtext')
-pub.set_writer('html')
+if self._v_formatted is None:
+# format with strings
+pub = docutils.core.Publisher()
+pub.set_reader('standalone', None, 'restructuredtext')
+pub.set_writer('html')
 
-# go with the defaults
-pub.get_settings()
+# go with the defaults
+pub.get_settings()
 
-# this is needed, but doesn't seem to do anything
-pub.settings._destination = ''
+# this is needed, but doesn't seem to do anything
+pub.settings._destination = ''
 
-# use the stylesheet chosen by the user
-pub.settings.stylesheet = self.stylesheet
+# use the stylesheet chosen by the user
+pub.settings.stylesheet = self.stylesheet
 
-# set the reporting level to something sane
-pub.settings.report_level = int(self.report_level)
+# set the reporting level to something sane
+pub.settings.report_level = int(self.report_level)
 

[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZReST/ Forward-port fix for collector #1927 from 2.8 branch.

2005-10-21 Thread Tres Seaver
Log message for revision 39551:
  Forward-port fix for collector #1927 from 2.8 branch.

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

-=-
Modified: Zope/trunk/lib/python/Products/ZReST/ZReST.py
===
--- Zope/trunk/lib/python/Products/ZReST/ZReST.py   2005-10-21 17:30:25 UTC 
(rev 39550)
+++ Zope/trunk/lib/python/Products/ZReST/ZReST.py   2005-10-21 17:46:13 UTC 
(rev 39551)
@@ -47,6 +47,7 @@
 '''
 meta_type =  'ReStructuredText Document'
 security = ClassSecurityInfo()
+_v_formatted = _v_warnings = None
 
 def __init__(self, id,output_encoding=None,
  input_encoding=None):
@@ -54,7 +55,7 @@
 self.title = id
 self.stylesheet = 'default.css'
 self.report_level = '2'
-self.source = self.formatted = ''
+self.source = ''
 
 from reStructuredText import default_output_encoding, \
  default_input_encoding
@@ -89,7 +90,7 @@
 '''
 if REQUEST is not None:
 REQUEST.RESPONSE.setHeader('content-type', 'text/html; charset=%s' 
% self.output_encoding)
-return self.formatted
+return self.render()
 
 security.declareProtected('View', 'source_txt')
 def source_txt(self, REQUEST=None):
@@ -113,7 +114,7 @@
 return self._er(data, SUBMIT, dtpref_cols, dtpref_rows, REQUEST)
 if data != self.source:
 self.source = data
-self.render()
+self._clear_cache()
 
 if REQUEST is not None:
 message=Saved changes.
@@ -142,6 +143,7 @@
 setCookie(dtpref_cols, cols, path='/', expires=e)
 REQUEST.other.update({dtpref_cols:cols, dtpref_rows:rows})
 return self.manage_main(self, REQUEST, __str__=self.quotedHTML(data))
+
 security.declarePrivate('quotedHTML')
 def quotedHTML(self,
text=None,
@@ -155,6 +157,18 @@
 if text.find(re) = 0: text=name.join(text.split(re))
 return text
 
+security.declarePrivate('_clear_cache')
+def _clear_cache(self):
+ Forget results of rendering.
+
+try:
+del self._v_formatted
+except AttributeError:
+pass
+try:
+del self._v_warnings
+except AttributeError:
+pass
 
 # handle uploads too
 security.declareProtected('Edit ReStructuredText', 'manage_upload')
@@ -165,7 +179,7 @@
 self.source = file
 else:
 self.source = file.read()
-self.render()
+self._clear_cache()
 
 if REQUEST is not None:
 message=Saved changes.
@@ -175,57 +189,60 @@
 def render(self):
 ''' Render the source to HTML
 '''
-# format with strings
-pub = docutils.core.Publisher()
-pub.set_reader('standalone', None, 'restructuredtext')
-pub.set_writer('html')
+if self._v_formatted is None:
+# format with strings
+pub = docutils.core.Publisher()
+pub.set_reader('standalone', None, 'restructuredtext')
+pub.set_writer('html')
 
-# go with the defaults
-pub.get_settings()
+# go with the defaults
+pub.get_settings()
 
-# this is needed, but doesn't seem to do anything
-pub.settings._destination = ''
+# this is needed, but doesn't seem to do anything
+pub.settings._destination = ''
 
-# use the stylesheet chosen by the user
-pub.settings.stylesheet = self.stylesheet
+# use the stylesheet chosen by the user
+pub.settings.stylesheet = self.stylesheet
 
-# set the reporting level to something sane
-pub.settings.report_level = int(self.report_level)
+# set the reporting level to something sane
+pub.settings.report_level = int(self.report_level)
 
-# Disallow inclusion of files for security reasons
-pub.settings.file_insertion_enabled = 0
+# disallow use of the .. include directive for security reasons
+pub.settings.file_insertion_enabled = 0
 
-# don't break if we get errors
-pub.settings.halt_level = 6
+# don't break if we get errors
+pub.settings.halt_level = 6
 
-# remember warnings
-pub.settings.warning_stream = Warnings()
+# remember warnings
+pub.settings.warning_stream = Warnings()
 
-pub.source = docutils.io.StringInput(
-source=self.source, encoding=self.input_encoding)
+pub.source = docutils.io.StringInput(
+source=self.source, encoding=self.input_encoding)
 
-# output - not that it's needed
-pub.settings.output_encoding = self.output_encoding
-pub.destination = 

[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/test_ZReST.py Repair copy-paste error.

2005-10-21 Thread Tres Seaver
Log message for revision 39552:
  Repair copy-paste error.

Changed:
  U   
Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/test_ZReST.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/test_ZReST.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/test_ZReST.py 
2005-10-21 17:46:13 UTC (rev 39551)
+++ Zope/branches/Zope-2_8-branch/lib/python/Products/ZReST/tests/test_ZReST.py 
2005-10-21 17:53:11 UTC (rev 39552)
@@ -21,7 +21,7 @@
 self.assertRaises(AttributeError, lambda: empty.warnings)
 
 self.assertEqual(empty._v_formatted, None)
-self.assertEqual(empty._v_formatted, None)
+self.assertEqual(empty._v_warnings, None)
 
 def test_formatted_ignored(self):
 resty = self._makeOne()

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


[Zope-dev] Re: Mountpoints

2005-10-21 Thread Florent Guillaume

Tim Peters wrote:

I think it's worse, but mostly because a key with name name is also
an option in _related_ sections, but with unrelated meaning.  For
example, if you had a nested zeoclient section there it could also
have specified a name key, which would have nothing to do with the
zodb key named name.  Nesting options with the same name gets
confusing quickly.  OTOH, I would like the explicit key better if it
had a different name, say

zodb
  multidb-name main
  filestorage
path $DATADIR/Data.fs
  /filestorage
/zodb
zodb
  multidb-name a
  filestorage
path $DATADIR/A.fs
  /filestorage
/zodb


Yes, please. There is already confusion for cache-size, let's not repeat 
that with another key. Note that database-name is more expressive, I think 
(the multi seems like an implementation detail to me).


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
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 )


Re: [Zope-dev] Re: [Zope-CMF] Better DeprecationWarnings (was Re: SVN: CMF/trunk/CMFDefault/Portal.py - reverted Portal.py change of r39125 to fix BBB temporarily)

2005-10-21 Thread Tim Peters
[Tim Peters]
 Note:  sometimes _internals_ use deprecated gimmicks in order to
 support deprecated gimmicks too, and then stacklevel=3 is too small.
 It's happened so rarely in ZODB that I haven't tried to do something
 about that yet.

[Chris Withers]
 Interestingly, I've found that even this is sometimes not enough, since
 you don't know whether you want the caller, the caller's caller or
 further up the chain than that.

I haven't seen much of that.  One place I did is in deprecating
subtransactions, where many paths thru the ZODB code have to pass on
the original is this a sub or a 'real' transaction? flag.  In those
cases, the relevant methods also grew an optional `deprecation_wng`
argument defaulting to True, and _internal_ calls to such methods
explicitly pass deprecation_wng=False.

 Is there any way to get the warnings stuff to actually emit a traceback
 so it can be followed?

No; the `warnings` module doesn't even import the `traceback` module,
let alone use it.  You can print a traceback yourself by using the
`traceback` module, and if you're determined enough you could replace
warnings.showwarning() with a function of your own (see the docs for
warnings.showwarning, and possible for traceback.print_stack).
___
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-dev] Re: Mountpoints

2005-10-21 Thread Tim Peters
[Tim Peters]
 I think it's worse, but mostly because a key with name name is also
 an option in _related_ sections, but with unrelated meaning.  For
 example, if you had a nested zeoclient section there it could also
 have specified a name key, which would have nothing to do with the
 zodb key named name.  Nesting options with the same name gets
 confusing quickly.  OTOH, I would like the explicit key better if it
 had a different name, say

 zodb
   multidb-name main
   filestorage
 path $DATADIR/Data.fs
   /filestorage
 /zodb
 zodb
   multidb-name a
   filestorage
 path $DATADIR/A.fs
   /filestorage
 /zodb

[Florent Guillaume]
 Yes, please. There is already confusion for cache-size, let's not repeat
 that with another key. Note that database-name is more expressive,
 I think

Since the name of the corresponding DB argument is database_name,
and all the docs that exist for this call it database_name too,
that's hard to argue against ;-)

 (the multi seems like an implementation detail to me).

Not really:  a DB's database_name was introduced specifically for the
new-in-ZODB-3.5 multidatabase feature, and has no meaning or use apart
from its multidatabase role.  That's better explained in the ZConfig
description section for the key than in the name of the key, though.

If Jim doesn't object soon, I'll proceed with adding a database-name
key to ZODB's config.
___
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-dev] Re: Mountpoints

2005-10-21 Thread Jim Fulton

Tim Peters wrote:

[Tim Peters]


I think it's worse, but mostly because a key with name name is also
an option in _related_ sections, but with unrelated meaning.  For
example, if you had a nested zeoclient section there it could also
have specified a name key, which would have nothing to do with the
zodb key named name.  Nesting options with the same name gets
confusing quickly.  OTOH, I would like the explicit key better if it
had a different name, say

   zodb
 multidb-name main
 filestorage
   path $DATADIR/Data.fs
 /filestorage
   /zodb
   zodb
 multidb-name a
 filestorage
   path $DATADIR/A.fs
 /filestorage
   /zodb



[Florent Guillaume]


Yes, please. There is already confusion for cache-size, let's not repeat
that with another key. Note that database-name is more expressive,
I think



Since the name of the corresponding DB argument is database_name,
and all the docs that exist for this call it database_name too,
that's hard to argue against ;-)



(the multi seems like an implementation detail to me).



Not really:  a DB's database_name was introduced specifically for the
new-in-ZODB-3.5 multidatabase feature, and has no meaning or use apart
from its multidatabase role.  That's better explained in the ZConfig
description section for the key than in the name of the key, though.



If Jim doesn't object soon, I'll proceed with adding a database-name
key to ZODB's config.


+1

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
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 )


Re: [Zope-dev] Re: Mountpoints

2005-10-21 Thread Chris McDonough
On Fri, 2005-10-21 at 11:13 -0400, Jim Fulton wrote:
  
  Not really:  a DB's database_name was introduced specifically for the
  new-in-ZODB-3.5 multidatabase feature, and has no meaning or use apart
  from its multidatabase role.  That's better explained in the ZConfig
  description section for the key than in the name of the key, though.
  
  If Jim doesn't object soon, I'll proceed with adding a database-name
  key to ZODB's config.

Note that I don't have a strong opinion about this either way but I will
note that at least Zope 2's subclass of the zodb config handler will
need to continue to be willing to use the section title as the database
name for backwards compatibility reasons, as people who have older Zopes
will want to use their older config files (which have zodb_db sections
that have section titles, and no database-name key) with new Zope
releases.

- C


___
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 )


Re: [Zope-dev] Re: Mountpoints

2005-10-21 Thread Tim Peters
[Chris McDonough]
| Note that I don't have a strong opinion about this either way but I will
 note that at least Zope 2's subclass of the zodb config handler will
 need to continue to be willing to use the section title as the database
 name for backwards compatibility reasons, as people who have older Zopes
 will want to use their older config files (which have zodb_db sections
 that have section titles, and no database-name key) with new Zope
 releases.

Note that when you look at Zope2's zopeschema.xml's zodb_db config,
there isn't a clue there that the section's name is used for
something, let alone what it's used for.  This lack of discoverability
goes away when using an named key, and that's a better long-term place
to be.

I don't expect that adding an optional named key to zodb config will
_stop_ zodb_db config from doing whatever it wants to do instead. 
If it does, I agree that would be a problem.
___
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-dev] Why is test.py silent by default

2005-10-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

The default usecase for running tests should be a developer making
changes and running tests.  In this case, silent mode is unhelpful;
it gives no feedback until the very end of the run, which takes a
**long** time for the whole Zope2 tree.  The dots provided at
verbosity level one are good feedback for the developer:  they provide a
clue about how many tests have run, and give some chance of deducing
that the tests have hung.

Unless somebody has a compelling counter-argument, I will check in a
patch which makes verbosity level 1 (dots) the default value.  People
who want quiet mode can always pass '-q'.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDWSAW+gerLs4ltQ4RAs3NAKCodcPqXIDlTJ3QGa4z8gFNc92LcACeJNLc
7ms5+UFjYgv+i/M6/I4eIOc=
=wEwp
-END PGP SIGNATURE-

___
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 )


Re: [Zope-dev] Why is test.py silent by default

2005-10-21 Thread Jim Fulton

Tres Seaver wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

The default usecase for running tests should be a developer making
changes and running tests.  In this case, silent mode is unhelpful;
it gives no feedback until the very end of the run, which takes a
**long** time for the whole Zope2 tree.  The dots provided at
verbosity level one are good feedback for the developer:  they provide a
clue about how many tests have run, and give some chance of deducing
that the tests have hung.

Unless somebody has a compelling counter-argument, I will check in a
patch which makes verbosity level 1 (dots) the default value.  People
who want quiet mode can always pass '-q'.


-1

I prefer not to get output unless there is a problem.  I'm happy to
defer to others, but I personally prefer less output.

BTW, within the next week, I will be integrating the new test
runner into z2 and z3.  So if people agree with you and we decide that
the default verbosity level should be 1, then I'll do that when I
integrate the new runner. (I guess I'll have to add a quiet option
to cancel a default verbosity level.)

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
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 )


Re: [Zope-dev] Why is test.py silent by default

2005-10-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jim Fulton wrote:
 Tres Seaver wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 The default usecase for running tests should be a developer making
 changes and running tests.  In this case, silent mode is unhelpful;
 it gives no feedback until the very end of the run, which takes a
 **long** time for the whole Zope2 tree.  The dots provided at
 verbosity level one are good feedback for the developer:  they provide a
 clue about how many tests have run, and give some chance of deducing
 that the tests have hung.

 Unless somebody has a compelling counter-argument, I will check in a
 patch which makes verbosity level 1 (dots) the default value.  People
 who want quiet mode can always pass '-q'.
 
 
 -1
 
 I prefer not to get output unless there is a problem.  I'm happy to
 defer to others, but I personally prefer less output.

Hmm, maybe we need a 'testrunner.rc' file with personal-preference
options, then.  Assuming that the script looked for it in sensible
places (homedir, instance_home/etc, maybe?), I could live without
changing the default in the script.

 BTW, within the next week, I will be integrating the new test
 runner into z2 and z3.  So if people agree with you and we decide that
 the default verbosity level should be 1, then I'll do that when I
 integrate the new runner. (I guess I'll have to add a quiet option
 to cancel a default verbosity level.)

Having such an option is usual, for the cases when some other script is
driving your testrunner;  if '-q' cancels any previous '-v' (explicit or
default), then you can shut off unneeded output driven by the upstream
script.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDWTmN+gerLs4ltQ4RAjPZAJ9NRehkIN9iMAZqfRvGjwjTeUJwAACfcWEi
rgpXVBO4k/sxsWccUmLA62E=
=BZX8
-END PGP SIGNATURE-
___
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 )


Re: [ZWeb] Re: [Zope.org-internal] Re: [Zopeorg-webmaster] Download of Zope 2.8.3 is not possible

2005-10-21 Thread Michael Haubenwallner

Chris Withers wrote:


Jim Fulton wrote:



I made an attempt to document the hardware setup.  I announced this
a long time ago.  If you have the right privileges, you can:

  svn co svn+ssh://svn.zope.org/repos/zope.org/system-documentation/trunk

I don't think it's up to date, but it does reflect at least a partial
reality.  I wish this would be kept up to date. :/



Yay! I have system docs now. Apologies to Andrew for not knowing these 
existed *blush*



  Anyway, I'm going to go and beat some walls down with my head. Hope
  the changes I've made help even a little...
 
  Much thanks Chris!

Michael, have you noticed this making any difference?



Works atm, the next zope release will show ...

Michael

--
http://zope.org/Members/d2m
http://planetzope.org

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


[Zope] ZCatalog: searching where on index == another index

2005-10-21 Thread Etienne Labuschagne
Hi all,

Is there a way to search for all the records where one indexed field
equals another indexed field?

Equivalent SQL query would be:

SELECT * FROM table WHERE field1 = field2

I know I can get all the unique values for field1 and then do a search
for records where field2 = [unique field1 values], but isn't there a
better way?

Etienne

___
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] ZCatalog: searching where on index == another index

2005-10-21 Thread Andreas Jung



--On 21. Oktober 2005 13:00:35 +0200 Etienne Labuschagne 
[EMAIL PROTECTED] wrote:



Hi all,

Is there a way to search for all the records where one indexed field
equals another indexed field?




no.

-aj

pgpT5FL2z86QW.pgp
Description: PGP signature
___
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] __getitem__ and returning a PageTemplateFile instance

2005-10-21 Thread Anders Bruun Olsen
On Thu, Oct 20, 2005 at 09:43:24PM +0200, Dieter Maurer wrote:
 asonhe is not there, but vitester has a __getitem__ method which
 executes a PageTemplateFile instance and returns it. I.e.
 Thus, it returns a string.
 However, ZPublisher requires that all intermediate traversal
 steps return an object which is not of a simple type and does
 have a docstring. A string is a simple type, you cannot use it
 during traversal...

Ahh.. that makes sense I guess. It just seems counterintuitive that you
can return a string in a normal function, but not in __getitem__.

 But that way I can't put any values in there. How can I do this then?
 Can can return a wrapper and give it a docstring.
 class Wrapper:
   '''a wrapper around a string.''' # this is the docstring
   def __init__(self, str):
 self.str = str
   def __call__(self): return self.str
 Some security declarations might be necessary as well.
 Probably, a class attribute __roles__ = None is sufficient.

Okay, that will work.

Thanks so much for your help, I really appreciated it.

-- 
Anders
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V
PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y?
--END GEEK CODE BLOCK--
PGPKey: 
http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=getsearch=0xD4DEFED0
___
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 )


[Zope] FTP or WebDav creates empty files

2005-10-21 Thread D Washburn




I have a desktop program that develops DTML
pages for a ZOPE/PLONE website. I planned to upload them via FTP or
WebDav.

When they arrive they are empty.

I can upload graphics via FTP and the images arrive OK. So basic
transfer works.

Any ideas on setting or changes needed to make the text files arrive
with their content as the body of a DTML document.

Thanks
David


___
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] database connections from external method

2005-10-21 Thread Chris Withers

Vangelis Mihalopoulos wrote:


Tino Wildenhain wrote:


The threading is handled by the ZDA, so you can use query() or what
the method actually is.


I couldn't find a method like that... any hints?


Have a look at the ZSQL methods code, I remember this being pretty old 
and convoluted :-(



Otoh, what do you think you gain from
circumventing ZSQL Methods?


Well, i am running zope under root privileges in read-only mode. 


What does this mean? What are you seeking to do or prevent?

If 
there is a Zope break-in, 


What does that mean?

i want to minimize interference with the 
database.


Which database?

Also, since this will be a commercial product, keeping most of the code 
in compiled python scripts is meaningful.


As Jens already explained, .pyc's and pyo's can be decompiled in a 
matter of minutes, so you're getting nothing for this worry other than 
finding debugging a pain ;-)


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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] database connections from external method

2005-10-21 Thread Chris Withers

Vangelis Mihalopoulos wrote:


I am loading the zodb in read-only mode. If someone breaks into Zope 


What do you mean by this?

(which btw i believe to be very secure) 


The why do you consider it a risk?

i don't want him to be able to 
directly access (read/write) the database i am using. *AFAIK*, 
ZSQLMethods won't do for this.


Then put constraints in on your database, or make the whole connection 
read-only.


You're really buying nothing with all this other than wasting a lot of 
your time...


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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] __getitem__ and returning a PageTemplateFile instance

2005-10-21 Thread Chris Withers

Anders Bruun Olsen wrote:


Ahh.. that makes sense I guess. It just seems counterintuitive that you
can return a string in a normal function, but not in __getitem__.


I have a feeling you're after traverse_subpath, which is available in 
both Python Scripts and Page Templates...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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] [OT] ParsedXML dev mail list

2005-10-21 Thread Chris Withers

Garito wrote:
Sorry for the off topic but I try to subscribe to ParsedXML dev mail 
list but I can't (mail list doesn't exists)


Doesn't look like it. Is ParsedXML an Infrae or a Zope Corp product?

You could always try asking about your problem on this list...

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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] Re: implicit vs. explicit ownership?

2005-10-21 Thread Chris Withers

Jürgen Herrmann wrote:

hmm, i'm a bit confused now. do you say that changeOwnershipType() only
has to do with executeable ownership?


Yep, I think so...


especially i have to know which methods of the IOwned interface are
essential and have to be reimplemented properly on my objects.


Why do you think you need to implement IOwned?


...but the fog is clearing up a little bit now, i thought that the
owner role would be completely dynamically assigned to a user by
getRolesInContext, now i see that this is done at object creation time
and more than one user can have the local role owner on an object.


The Owner role is something of a dead chicken. Don't rely on it and 
ignore it as best you can unless you're really sure what you're doing...



for my use cases i'd prefer to let getRolesInContext() add the owner
role to it's return list if the (runtime and proprietary) owner check
tells it to. any contraindications (besides performance, possibly)?


Well, confusion. I'd just get a new role name and use that for whatever 
you want to do...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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] write file to FS (LocalFS?)

2005-10-21 Thread Chris Withers

Dieter Maurer wrote:

Be careful with External Methods and locks:

  An External Method does not share the module namespace
  with the same External Methods in other workers.

  Thus, you should not use locks defined in the source file
  of the External Method (but outside in a true Python module).


Good point!

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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] Re: inheriting from SimpleUserFolder's User

2005-10-21 Thread Chris Withers

Florent Guillaume wrote:


Actually all third-party userfolders I know of reimplement allowed() in 
terms of calling getRolesInContext().


SUF doesn't, it aims to keep Simple ;-)

I would like to see this fixed in Zope though, I agree the code that's 
there probably isn't much fo a performance win...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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 )


[Zope] Re: implicit vs. explicit ownership?

2005-10-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris Withers wrote:
 Jürgen Herrmann wrote:
 
 hmm, i'm a bit confused now. do you say that changeOwnershipType() only
 has to do with executeable ownership?
 
 
 Yep, I think so...
 
 especially i have to know which methods of the IOwned interface are
 essential and have to be reimplemented properly on my objects.
 
 
 Why do you think you need to implement IOwned?

Unless Juergen's object is code-like, IOwned is a distraction;
ownable objects exist only to prevent trojaning (as Chris correctly
pointed out earlier).

 ...but the fog is clearing up a little bit now, i thought that the
 owner role would be completely dynamically assigned to a user by
 getRolesInContext, now i see that this is done at object creation time
 and more than one user can have the local role owner on an object.
 
 
 The Owner role is something of a dead chicken. Don't rely on it and
 ignore it as best you can unless you're really sure what you're doing...

I don't know why you would say that.  The Owner local role (as opposed
to executable ownership) is widely used to allow creators of content to
edit it in places where they would otherwise be unable to do so.


 for my use cases i'd prefer to let getRolesInContext() add the owner
 role to it's return list if the (runtime and proprietary) owner check
 tells it to. any contraindications (besides performance, possibly)?

It *is* possible to hijack the role computation here;  getting it right
is tricky, however, and when it is wrong, your error messages are going
to be inscrutable.  The right place to do this might be in a custom
user folder, rather than in content.  PAS, for instance, has the concept
of making the role computation for the *user* pluggable.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDWQ/D+gerLs4ltQ4RAqGEAKC90sJHo7JjtfSGowvBpLbGxpvt4wCdGCm5
Yp0mtxCE1M2hL6SIgYRF7wo=
=l8J6
-END PGP SIGNATURE-

___
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 )


[Zope] Question: What Workflow tool to choose?

2005-10-21 Thread Robert Boyd
I've been tasked with rapidly developing a demo for a proposed workflow
application using Zope. I have plenty of CMF experience including
customized workflows based on DCWorkflow, but I'm wondering what other
workflows are actively supported and of production quality. In the past
I've read blurbs about OpenFlow, ReFlow, and a Google search today
turned up those and Metaflow and some others. However, many of them are
dead-ends.

Openflow's site is a 404 Not Found (in Italian)
Metaflow: a 2002 article on ZopeMag sounded interesting, but no link to
the software and I can't find it. Plus, old posts on this list make it
sound problematic.
Reflow turned into CMFOpenflow, which was a fork of Openflow?
JaWE2Openflow sounded interesting, but the links are 404 Not Found.

Is CMF(DC)Workflow my best option? My application would most likely
*not* need other CMF tools, I might want it as a straight Zope 2
application. Also, I'm very new to Zope 3, does it include any workflow
or have any available?

Thanks,
Rob

___
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] Question: What Workflow tool to choose?

2005-10-21 Thread Andreas Jung



--On 21. Oktober 2005 12:18:31 -0400 Robert Boyd [EMAIL PROTECTED] 
wrote:



I've been tasked with rapidly developing a demo for a proposed workflow
application using Zope. I have plenty of CMF experience including
customized workflows based on DCWorkflow, but I'm wondering what other
workflows are actively supported and of production quality. In the past
I've read blurbs about OpenFlow, ReFlow, and a Google search today turned
up those and Metaflow and some others. However, many of them are
dead-ends.


The only reasonable workflow systems are DCWorkflow and Alphaflow (requires 
Plone). Everything else is more or less old and unmaintained or at least 
not very much usable.


-aj


pgpO0PXUDdugf.pgp
Description: PGP signature
___
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] [OT] ParsedXML dev mail list

2005-10-21 Thread Fred Drake
On 10/21/05, Chris Withers [EMAIL PROTECTED] wrote:
 Garito wrote:
  Sorry for the off topic but I try to subscribe to ParsedXML dev mail
  list but I can't (mail list doesn't exists)

 Doesn't look like it. Is ParsedXML an Infrae or a Zope Corp product?

 You could always try asking about your problem on this list...

It was originally a Zope Corp product, and still lives in the zope.org
CVS.  I don't think anyone here is currently using it for anything,
though.

There is a zope-xml list that came into existance back when we were
developing that, but its been nothing but spambait for the past couple
of years.  It should probably be retired.


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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] ZCatalog: searching where on index == another index

2005-10-21 Thread Dieter Maurer
Etienne Labuschagne wrote at 2005-10-21 13:00 +0200:
Is there a way to search for all the records where one indexed field
equals another indexed field?

Equivalent SQL query would be:

SELECT * FROM table WHERE field1 = field2

If the index has only a few different values,
enumerating them may be feasible.

With AdvancedQuery, this could look like:

 from Products.AdvancedQuery import Or, Eq

 query = Or(*[Eq(I1,v)  Eq(I2,v) for v in I1.unique(Values)])

-- 
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] FTP or WebDav creates empty files

2005-10-21 Thread Dieter Maurer
D Washburn wrote at 2005-10-21 10:03 -0400:
I have a desktop program that develops DTML pages for a ZOPE/PLONE 
website. I planned to upload them via FTP or WebDav.

When they arrive they are empty.

This usually works.

Are you sure, your files do not contain bugs?
Can you upload the same file via HTTP without problems?

The so called safety belt may also cause problems --
the safety belt is there to protect against overwriting
a modified document. CMF had a bug that in case of a differing
safety belt, the target object was cleared.

-- 
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] __getitem__ and returning a PageTemplateFile instance

2005-10-21 Thread Dieter Maurer
Anders Bruun Olsen wrote at 2005-10-21 15:06 +0200:
 ...
Ahh.. that makes sense I guess. It just seems counterintuitive that you
can return a string in a normal function, but not in __getitem__.

Can can return a string from __getitem__ (without problem),
*but* you cannot use this string during URL traversal.

By the way, it does not matter for URL traversal whether the string (or
other simple type object or object without docstring) was
returned by __getitem__, getattr or __bobo_traverse__
(these are the possibilities to obtain the subobject during URL
traversal) -- the publisher will in all cases reject it.


-- 
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 )


[Zope] Zope crashing a RedHat installation?

2005-10-21 Thread Aaron Bauman
Hi,
We're running Zope 2.7.3, Plone 1.0.something 
relatively large Data.fs (  300MB )
Decent amount of anonymous traffic, 
But relatively low administrative use (1 - 2 users usually).

Could these factors be brining the machine down?
I've been getting intermittent 'corrupted data' messages for some time, but
only recently been experiencing serious downtime.
Is it time to seriously look at cleaning up the ZODB and upgrading?
Or is my web host just trying to sell me more hardware?

Any help much appreciated,
-
Aaron Bauman
http://www.gaycenter.org

___
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] Zope crashing a RedHat installation?

2005-10-21 Thread Rakotomandimby Mihamina
On Fri, 2005-10-21 at 15:50 -0400, Aaron Bauman wrote:
 Hi,

Hi,

 We're running Zope 2.7.3, Plone 1.0.something 
 relatively large Data.fs (  300MB )
 But relatively low administrative use (1 - 2 users usually).
 Could these factors be brining the machine down?

What products? just Plone 1.0.x?

 I've been getting intermittent 'corrupted data' messages for some
 time, but
 only recently been experiencing serious downtime.

What kind of hosting: dedicated? shared?

-- 
Administration  Formation à l'administration
de serveurs dédiés:
http://www.google.fr/search?q=aspo+infogerance+serveur

___
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] Zope crashing a RedHat installation?

2005-10-21 Thread Jens Vagelpohl


On 21 Oct 2005, at 20:50, Aaron Bauman wrote:


Hi,
We're running Zope 2.7.3, Plone 1.0.something
relatively large Data.fs (  300MB )
Decent amount of anonymous traffic,
But relatively low administrative use (1 - 2 users usually).

Could these factors be brining the machine down?
I've been getting intermittent 'corrupted data' messages for some  
time, but

only recently been experiencing serious downtime.
Is it time to seriously look at cleaning up the ZODB and upgrading?
Or is my web host just trying to sell me more hardware?


Not sure what you specifically mean by crashing and bringing  
down, but Zope and/or Python simply aren't known for crashing the  
operating system. What exactly are the symptoms that you are seeing?


jens

___
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 )


[Zope] Zope Install Best Practice - Newbie Questions

2005-10-21 Thread Russell Winter



Folks,

First post from a 
real newbie, I have currently got Zope installed under a test server and would 
like to ensure that I get things right for our production environment. Being a 
complete newbie to Zope I would like to be sure I am doing things right and 
understood the numerous articles I have read, any assistance would be greatly 
appreciated.

Currently, I made a 
user account; " zopeuser ", I installed Zope via this account and I can access 
the management interface without issues and managed to get a Plone installation 
working with mod_rewrite  mod_proxy via apache (we have a cPanel dedicated 
server). However,I think I may have made some fundamental administration 
or poor practice errors.

When I compiled 
Zope, my source is in the same directory as my final instance, is this a 
security issue or at least poor practice, is there a better way to do this? If, 
so could someone point me in the right procedural direction to install 
Zope.

I shall be 
uninstalling the instance I have, so a fresh install will be completed for the 
production instance. We are planning on running several Plone instances for 
different domain web-sites, so that each site can be managed separately by each 
different department.

Does anybody know of 
any issues that we are likely to bump in torunning Zope under a cPanel 
based server, to date I have manually added Plone accounts in the httpd.conf but 
will also be adding a few standard cPanel Apache based domains through the 
control panel as well, in time.

Thanks for your 
thoughts, I am learning still and hopefully learning quickly, so hopefully my 
very basic questions will reduce over a short period of time 
grin.


Regards, 

Russ 
WinterThis e-mail message and accompanying data may contain information 
that is confidential and subject to privilege. If you are not the intended 
recipient, you are notified that any use, dissemination, distribution or copying 
of this message or data is prohibited. If you have received this e-mail in error 
please notify us immediately and delete all material pertaining to this 
e-mail.

___
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] fine grained, dynamic permissions based on attribute values

2005-10-21 Thread Robert Boyd
On 10/18/05, Chris Crownhart [EMAIL PROTECTED] wrote:
 Good day,

 I am wondering if/how I could control the permissions on an object based
 on the value of an attribute.

 So, as an example, I have multiple users, and multiple values for the
 category field.  I would like User A to access the object if the
 category ='financial', and User B access the object if the
 category='other'.

If, as Mark asked, different users with different access privileges
have different roles, then how about writing a condition (TALES
expression) for the View action of your content type? Something along
the lines of

python: member and (member.has_role('Accountant') and
context.category=='financial') or (member.has_role('Editor') and
context.category=='other')

Don't quote me on the exact expression, though, you should test that.

Rob
___
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] Zope Install Best Practice - Newbie Questions

2005-10-21 Thread robert rottermann

Russel,
we do install our zope/plone instances in a simmilar way you did.
in addition to the steps you described we the do the following
- make Zope-2.7 and Zope-2.8 a softlink to the respective source 
directory and then create the instances from
 the Zope-2.X/bin directory. the mkzope/zeoinstance scripts create 
startupscripts with hardcoded paths.
 With ZopeX a softlink you can easily make updates to minor new zope 
releases for all your instances
- in the zopeusers homedirectory we have a Products directory where we 
have all the products installed.
 In the instances/Product folders we then link to them. Again we have 
Plone-1/2/2.1 links pointing to
 the respective Releases, so we can make minor Plone updates without 
hassle.


robert

Russell Winter wrote:

Folks,

First post from a real newbie, I have currently got Zope installed under a
test server and would like to ensure that I get things right for our
production environment. Being a complete newbie to Zope I would like to be
sure I am doing things right and understood the numerous articles I have
read, any assistance would be greatly appreciated.

Currently, I made a user account;  zopeuser , I installed Zope via this
account and I can access the management interface without issues and managed
to get a Plone installation working with mod_rewrite  mod_proxy via apache
(we have a cPanel dedicated server). However, I think I may have made some
fundamental administration or poor practice errors.

When I compiled Zope, my source is in the same directory as my final
instance, is this a security issue or at least poor practice, is there a
better way to do this? If, so could someone point me in the right procedural
direction to install Zope.

I shall be uninstalling the instance I have, so a fresh install will be
completed for the production instance. We are planning on running several
Plone instances for different domain web-sites, so that each site can be
managed separately by each different department.

Does anybody know of any issues that we are likely to bump in to running
Zope under a cPanel based server, to date I have manually added Plone
accounts in the httpd.conf but will also be adding a few standard cPanel
Apache based domains through the control panel as well, in time.

Thanks for your thoughts, I am learning still and hopefully learning
quickly, so hopefully my very basic questions will reduce over a short
period of time grin.



Regards, 

Russ Winter 


This e-mail message and accompanying data may contain information that is
confidential and subject to privilege. If you are not the intended
recipient, you are notified that any use, dissemination, distribution or
copying of this message or data is prohibited. If you have received this
e-mail in error please notify us immediately and delete all material
pertaining to this e-mail.



 



___
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 )
 


___
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 )


[Zope] Re: use Data.fs from mountpoint B to populate mountpoint A - how?

2005-10-21 Thread Dieter Maurer
Please send all Zope related questions to a Zope related mailing
list and not to me privately.

Usually, I do not answer questions sent to me privately!

I added zope@zope.org.

Christoph Berendes wrote at 2005-10-21 14:12 -0400:
I created a mount point, /default_site and a corresponding directory 
var/default_site.  I build my plone site from scratch into 
default_site/site001, and all is good.

I then create a second mount point /kitchensbyartisan and a 
corresponding directory var/kitchensbyartisan.  I copy 
var/default_site/Data.fs into var/kitchensbyartisan. Make the new_site 
mount point in the ZMI, restart a lot etc.

However, when I then navigate in the ZMI to kitchensbyartisan, it's 
empty and doesn't show site001 (or anything)

Do I  need something fancier than the following in zope.conf, some 
reference to default_site?

zodb_db kitchensbyartisan
mount-point /kitchensbyartisan
filestorage
path $INSTANCE/var/kitchensbyartisan/Data.fs
/filestorage
/zodb_db

When you use this simple mount-point syntax, then the mount
path is coded into the generated storage and you cannot
mount the storage under a different path.


Actually, the mount-point syntax is much more complex than the form
you use above. Among others, it supports

   mount-point  mount-path:storage-path

mount-path describes how you reach the mount point
in the mounting application and storage-path how you
find the mounted object from the storage root.

An example would be:

   mount-point   /F1/F2/XXX:/S1/XXX

Note that the last component in both paths *MUST* be identical
(otherwise, Zope's url construction no longer works with
URL traversal).

Usually, the storage-path will look like /XXX (where XXX is
some id (without '/')).


If storage-path is not given, it defaults to mount-path (this
explains why you do not see anything in your storage).


To summarize:

  *  always explicitely give a storage path

  *  use a storage path of the form /id

  *  then you can mount the storage at different places
 *BUT* you must never mount with a different id
 (the mount point must have the same id as that of the
 mounted object).

-- 
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-DB] MySQL

2005-10-21 Thread Michele Marcionelli

Ciao Dario,


I want to use MySQL in my Zope Installation.
But I'm not able to install software (I don't really understand what
shall I use and what shall I do...) I'm using
Zope: 2.8.1
MySQL 4.1
Windows XP


You have to install MySQL for Python:
http://sourceforge.net/projects/mysql-python

Copy the ZMySQLDA Zope Product in your Protucts-folder:
http://www.zope.org/Members/adustman/Products/ZMySQLDA

Restart zope.

Log in as manager in the ZMI and add a Z MySQL Database Connection 
with the correspondig info of your server.
After that you can use the SQL Method to query your MySQL server via 
the Z MySQL Database Connection.


Cheers,
Michele

--
[EMAIL PROTECTED] / phone: +41 44 632 6193
eth zentrum / hg g 14 / raemistrasse 101 - ch-8092 zurich


!DSPAM:4358c39817241410093335!

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] MySQL

2005-10-21 Thread Michele Marcionelli
When I try to execute MySQL-python.exe-1.2.0.win32-py2.4.exe I receive 
a

message Box saying: ...MSVCR71.dll not found (I receive a message in
italian..) Thanks Dario


I'm sorry, but I don't live in the Windows world...

With a quick google-search I found:

.NET Framework SDK Version 1.1: Provides the core
msvcrt.lib for msvcr71.dll against which to link your
extensions. [...]

Maybe you should try to install it also:
http://msdn.microsoft.com/netframework/

Cheers,
Michele

--
[EMAIL PROTECTED] / phone: +41 44 632 6193
eth zentrum / hg g 14 / raemistrasse 101 - ch-8092 zurich

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] Closing idle DCoracle2 Connections?

2005-10-21 Thread Chris Withers

Cynthia Kiser wrote:

open. FYI just closing the database connection via the ZMI does not
release the idle connections Oracle still sees. 


Yes, that button actually does nothing ;-)

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] Closing idle DCoracle2 Connections?

2005-10-21 Thread Chris Withers

Dieter Maurer wrote:

Usually, there is not need for a sophisticated connection
management. Just do not create unnecessary DA instances.


Yes, this is the most common mistake...


Bugs should be fixed and not worked around with more complex
software (complex connection management).


Well, it depends, there can be a need for lots of infrequently used DA's 
connecting to the same database. Having these be able to share 
connections can be useful.



I know that I wouldn't want the connection being closed from Oracles
side as I have read in the mailinglist that DCOracle would still think
the connection is open and generate an error.


The DA catches OperationalErrors and reopens the connection.
It tries to do this transparently (though a bit wrong).


Well, it doesn't succeed for Not Connected and several other salient 
Oracle errors.


FWIW, if people can, I'd recommend moving to cxOracle. There's more life 
there now :-(


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db