[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/ also create rundirectory/socketdirectory when configured from config file

2009-01-29 Thread Christian Zagrodnick
Log message for revision 95380:
  also create rundirectory/socketdirectory when configured from config file
  

Changed:
  U   zdaemon/trunk/src/zdaemon/component.xml
  U   zdaemon/trunk/src/zdaemon/tests/testzdrun.py
  U   zdaemon/trunk/src/zdaemon/zdoptions.py

-=-
Modified: zdaemon/trunk/src/zdaemon/component.xml
===
--- zdaemon/trunk/src/zdaemon/component.xml 2009-01-29 08:09:28 UTC (rev 
95379)
+++ zdaemon/trunk/src/zdaemon/component.xml 2009-01-29 08:32:15 UTC (rev 
95380)
@@ -78,7 +78,8 @@
   /description
 /key
 
-key name=socket-name datatype=existing-dirpath
+key name=socket-name
+ datatype=zdaemon.zdoptions.existing_parent_dirpath
  required=no
  default=zdsock
   description
@@ -113,7 +114,8 @@
   /description
 /key
 
-key name=directory datatype=existing-directory
+key name=directory
+ datatype=zdaemon.zdoptions.existing_parent_directory
  required=no
   description
 Command-line option: -z or --directory.

Modified: zdaemon/trunk/src/zdaemon/tests/testzdrun.py
===
--- zdaemon/trunk/src/zdaemon/tests/testzdrun.py2009-01-29 08:09:28 UTC 
(rev 95379)
+++ zdaemon/trunk/src/zdaemon/tests/testzdrun.py2009-01-29 08:32:15 UTC 
(rev 95380)
@@ -319,6 +319,9 @@
 sys.stdout = StringIO()
 sys.stderr = StringIO()
 self.expect = ''
+self.cmd = /bin/true
+if not os.path.exists(self.cmd):
+self.cmd = /usr/bin/true  # Mac OS X
 
 def tearDown(self):
 shutil.rmtree(self.root)
@@ -332,23 +335,30 @@
 super(TestRunnerDirectory, self).tearDown()
 
 def run_ctl(self, opts):
-true_cmd = /bin/true
-if not os.path.exists(true_cmd):
-true_cmd = /usr/bin/true  # Mac OS X
 options = zdctl.ZDCtlOptions()
-options.realize(opts + ['-p', 'sleep 1', 'fg'])
-self.expect = 'sleep 1\n'
+options.realize(opts + ['fg'])
+self.expect = self.cmd + '\n'
 proc = zdctl.ZDCmd(options)
 proc.onecmd( .join(options.args))
 
 def testCtlRunDirectoryCreation(self):
 path = os.path.join(self.root, 'rundir')
-self.run_ctl(['-z', path])
+self.run_ctl(['-z', path, '-p', self.cmd])
 self.assert_(os.path.exists(path))
 
+def testCtlRunDirectoryCreationFromConfigFile(self):
+path = os.path.join(self.root, 'rundir')
+options = ['directory ' + path,
+   'program ' + self.cmd]
+config = self.writeConfig(
+'runner\n%s\n/runner' % '\n'.join(options))
+self.run_ctl(['-C', config])
+self.assert_(os.path.exists(path))
+
 def testCtlRunDirectoryCreationOnlyOne(self):
 path = os.path.join(self.root, 'rundir', 'not-created')
-self.assertRaises(SystemExit, self.run_ctl, ['-z', path])
+self.assertRaises(SystemExit,
+  self.run_ctl, ['-z', path, '-p', self.cmd])
 self.assertFalse(os.path.exists(path))
 got = sys.stderr.getvalue().strip()
 sys.stderr = StringIO()
@@ -356,19 +366,33 @@
 
 def testCtlSocketDirectoryCreation(self):
 path = os.path.join(self.root, 'rundir', 'sock')
-self.run_ctl(['-s', path])
+self.run_ctl(['-s', path, '-p', self.cmd])
 self.assert_(os.path.exists(os.path.dirname(path)))
 
-
 def testCtlSocketDirectoryCreationOnlyOne(self):
 path = os.path.join(self.root, 'rundir', 'not-created', 'sock')
-self.assertRaises(SystemExit, self.run_ctl, ['-s', path])
+self.assertRaises(SystemExit,
+  self.run_ctl, ['-s', path, '-p', self.cmd])
 self.assertFalse(os.path.exists(path))
 got = sys.stderr.getvalue().strip()
 sys.stderr = StringIO()
 self.assertTrue(got.startswith('Error: invalid value for -s'))
 
+def testCtlSocketDirectoryCreationFromConfigFile(self):
+path = os.path.join(self.root, 'rundir')
+options = ['socket-name %s/sock' % path,
+   'program ' + self.cmd]
+config = self.writeConfig(
+'runner\n%s\n/runner' % '\n'.join(options))
+self.run_ctl(['-C', config])
+self.assert_(os.path.exists(path))
 
+def writeConfig(self, config):
+config_file = os.path.join(self.root, 'config')
+open(config_file, 'w').write(config)
+return config_file
+
+
 def send_action(action, sockname):
 Send an action to the zdrun server and return the response.
 

Modified: zdaemon/trunk/src/zdaemon/zdoptions.py
===
--- zdaemon/trunk/src/zdaemon/zdoptions.py  2009-01-29 08:09:28 UTC (rev 
95379)
+++ zdaemon/trunk/src/zdaemon/zdoptions.py  2009-01-29 08:32:15 UTC (rev 
95380)
@@ -403,6 +403,9 @@
 
 def 

[Zope-Checkins] SVN: zdaemon/trunk/src/zdaemon/ fix directory chown and add a test

2009-01-29 Thread Christian Zagrodnick
Log message for revision 95384:
  fix directory chown and add a test
  

Changed:
  U   zdaemon/trunk/src/zdaemon/tests/testzdrun.py
  U   zdaemon/trunk/src/zdaemon/zdctl.py

-=-
Modified: zdaemon/trunk/src/zdaemon/tests/testzdrun.py
===
--- zdaemon/trunk/src/zdaemon/tests/testzdrun.py2009-01-29 08:35:16 UTC 
(rev 95383)
+++ zdaemon/trunk/src/zdaemon/tests/testzdrun.py2009-01-29 08:43:30 UTC 
(rev 95384)
@@ -392,7 +392,31 @@
 open(config_file, 'w').write(config)
 return config_file
 
+def testDirectoryChown(self):
+path = os.path.join(self.root, 'foodir')
+options = zdctl.ZDCtlOptions()
+options.realize(['-p', self.cmd])
+cmd = zdctl.ZDCmd(options)
+options.uid = 27
+options.gid = 28
+# Patch chown and geteuid, because we're not root
+chown = os.chown
+geteuid = os.geteuid
+calls = []
+def my_chown(*args):
+calls.append(('chown',) + args)
+def my_geteuid():
+return 0
+try:
+os.chown = my_chown
+os.geteuid = my_geteuid
+cmd.create_directory(path)
+finally:
+os.chown = chown
+os.geteuid = geteuid
+self.assertEqual([('chown', path, 27, 28)], calls)
 
+
 def send_action(action, sockname):
 Send an action to the zdrun server and return the response.
 

Modified: zdaemon/trunk/src/zdaemon/zdctl.py
===
--- zdaemon/trunk/src/zdaemon/zdctl.py  2009-01-29 08:35:16 UTC (rev 95383)
+++ zdaemon/trunk/src/zdaemon/zdctl.py  2009-01-29 08:43:30 UTC (rev 95384)
@@ -167,7 +167,7 @@
 uid = os.geteuid()
 if uid == 0 and uid != self.options.uid:
 # Change owner of directory to target
-os.chown(self.options.uid, self.options.gid)
+os.chown(directory, self.options.uid, self.options.gid)
 
 def set_uid(self):
 if self.options.uid is None:

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


[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/OFS/tests/testCopySupportHooks.py Merged trunk r95406 into 2.10 branch.

2009-01-29 Thread Stefan H. Holek
Log message for revision 95427:
  Merged trunk r95406 into 2.10 branch.
  
  Use a layer to load the CA (we need the container handlers).
  

Changed:
  U   Zope/branches/2.10/lib/python/OFS/tests/testCopySupportHooks.py

-=-
Modified: Zope/branches/2.10/lib/python/OFS/tests/testCopySupportHooks.py
===
--- Zope/branches/2.10/lib/python/OFS/tests/testCopySupportHooks.py 
2009-01-29 13:08:34 UTC (rev 95426)
+++ Zope/branches/2.10/lib/python/OFS/tests/testCopySupportHooks.py 
2009-01-29 13:13:50 UTC (rev 95427)
@@ -5,6 +5,9 @@
 
 import transaction
 
+from zope.testing import cleanup
+from Products.Five import zcml
+
 from Testing.makerequest import makerequest
 
 from AccessControl.SecurityManagement import newSecurityManager
@@ -55,12 +58,27 @@
 
 
 from Products.Five.eventconfigure import setDeprecatedManageAddDelete
-setDeprecatedManageAddDelete(TestItem)
-setDeprecatedManageAddDelete(TestFolder)
 
+class HookLayer:
 
+@classmethod
+def setUp(cls):
+cleanup.cleanUp()
+zcml._initialized = 0
+zcml.load_site()
+setDeprecatedManageAddDelete(TestItem)
+setDeprecatedManageAddDelete(TestFolder)
+
+@classmethod
+def tearDown(cls):
+cleanup.cleanUp()
+zcml._initialized = 0
+
+
 class HookTest(unittest.TestCase):
 
+layer = HookLayer
+
 def setUp(self):
 self.app = makerequest(Zope2.app())
 try:

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


[Zope-Checkins] SVN: Zope/branches/2.11/lib/python/OFS/tests/testCopySupportHooks.py Merged trunk r95406 into 2.11 branch.

2009-01-29 Thread Stefan H. Holek
Log message for revision 95426:
  Merged trunk r95406 into 2.11 branch.
  
  Use a layer to load the CA (we need the container handlers).
  

Changed:
  U   Zope/branches/2.11/lib/python/OFS/tests/testCopySupportHooks.py

-=-
Modified: Zope/branches/2.11/lib/python/OFS/tests/testCopySupportHooks.py
===
--- Zope/branches/2.11/lib/python/OFS/tests/testCopySupportHooks.py 
2009-01-29 12:43:33 UTC (rev 95425)
+++ Zope/branches/2.11/lib/python/OFS/tests/testCopySupportHooks.py 
2009-01-29 13:08:34 UTC (rev 95426)
@@ -5,6 +5,9 @@
 
 import transaction
 
+from zope.testing import cleanup
+from Products.Five import zcml
+
 from Testing.makerequest import makerequest
 
 from AccessControl.SecurityManagement import newSecurityManager
@@ -55,12 +58,27 @@
 
 
 from Products.Five.eventconfigure import setDeprecatedManageAddDelete
-setDeprecatedManageAddDelete(TestItem)
-setDeprecatedManageAddDelete(TestFolder)
 
+class HookLayer:
 
+@classmethod
+def setUp(cls):
+cleanup.cleanUp()
+zcml._initialized = 0
+zcml.load_site()
+setDeprecatedManageAddDelete(TestItem)
+setDeprecatedManageAddDelete(TestFolder)
+
+@classmethod
+def tearDown(cls):
+cleanup.cleanUp()
+zcml._initialized = 0
+
+
 class HookTest(unittest.TestCase):
 
+layer = HookLayer
+
 def setUp(self):
 self.app = makerequest(Zope2.app())
 try:

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


[Zope-Checkins] SVN: Zope/trunk/doc/CHANGES.txt Not yet.

2009-01-29 Thread Stefan H. Holek
Log message for revision 95428:
  Not yet.

Changed:
  U   Zope/trunk/doc/CHANGES.txt

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2009-01-29 13:13:50 UTC (rev 95427)
+++ Zope/trunk/doc/CHANGES.txt  2009-01-29 13:16:22 UTC (rev 95428)
@@ -9,8 +9,6 @@
 
 Restructuring
 
-  - Using ZODB 3.9
-
   - Disabled the XML export on the UI level - the export functionality
 however is still available on the Python level.
 

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


Re: [Zope-dev] zope.security changes

2009-01-29 Thread Martijn Faassen
Hey,

Dan Korostelev wrote:
[snip]

 What about the other use case of class, i.e. declaring implemented
 interfaces, as in

  class class=.foreignmodule.SomeClass
implements interface=.interfaces.ISomeInterface /
  /class
 
 +1. That's kinda strange to have it in zope.security.
 
 I think, the better place to move zcml directives is zope.component,
 as it already depends on zope.security for the zcml support and the
 class directive also has component-related factory subdirective
 which declared in zope.component.

It's true class isn't purely about security. It's not purely about 
component configuration either, though.

Most of what 'class' is about is security-related, so it's using a lot 
of stuff in zope.security. If you look at the implementation, I think 
people would agree it's doing more security manipulation then it's doing 
component configuration. And I think we can at least agree zope.security 
is at least an improvement in location compared to their scattered 
implementation throughout zope.app.component and zope.app.security.

So, I don't think we'll be moving class (and then module) into 
zope.component this week during the sprint, and not just because it'd 
distract us from our main goal to reach layered dependencies.

I believe that zope.component relying on zope.security (if indeed [zcml] 
is enabled) is actually something that could be avoided if we moved the 
ZCML directive implementations from zope.component entirely. When you 
install zope.component without ZCML support, you get a reasonable 
dependency list actually installed. When you do use the ZCML dependency 
it starts pulling in a lot more, including quite unreasonable stuff like 
zope.publisher and zope.traversing. See this for more information:

http://plope.com/Members/chrism/pluginizing_an_app

I believe it'd be nicer to extract any ZCML related stuff from 
zope.component at some point and put it into zope.componentzcml or 
something like that. We could then decide to move the class and 
module directives in there as well.

Regards,

Martijn

___
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] Outage wiki.zope.org

2009-01-29 Thread Christian Theune
wiki.zope.org is down. The hosting centre operator just sent a mail
that they have power outages and the location at which wiki.zope.org
sits is affected.

Christian

-- 
Christian Theune · c...@gocept.com
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
___
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] zope.security changes

2009-01-29 Thread Fred Drake
On Thu, Jan 29, 2009 at 4:01 AM, Martijn Faassen faas...@startifact.com wrote:
 I believe it'd be nicer to extract any ZCML related stuff from
 zope.component at some point and put it into zope.componentzcml or
 something like that. We could then decide to move the class and
 module directives in there as well.

+1

This makes a lot more sense to me than having the ZCML support in
either zope.component or zope.security.


  -Fred

-- 
Fred L. Drake, Jr.fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
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] Outage wiki.zope.org

2009-01-29 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Jan 29, 2009, at 14:42 , Christian Theune wrote:

 wiki.zope.org is down. The hosting centre operator just sent a mail
 that they have power outages and the location at which wiki.zope.org
 sits is affected.

All services should be restored. One of the two servers run by the  
Zope Foundation had a network failure, presumably after the server  
restarted following the power failure.

If there are any issues please contact me off-list.

jens


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

iEYEARECAAYFAkmBx9MACgkQRAx5nvEhZLJlywCaAnusVCMCtzCflfxtJl8tdPrj
fa8AniZi3jrDMCnX45usaKIZbeo9SJ0V
=1eDx
-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] SVN: zope.container/trunk/ Remove zope.app.component dependency. Declare zope.app.dependable

2009-01-29 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Martijn Faassen wrote:
 Log message for revision 95421:
   Remove zope.app.component dependency. Declare zope.app.dependable
   dependency which should've been declared already.

snip

 Modified: zope.container/trunk/src/zope/container/testing.py
 ===
 --- zope.container/trunk/src/zope/container/testing.py2009-01-29 
 12:15:45 UTC (rev 95420)
 +++ zope.container/trunk/src/zope/container/testing.py2009-01-29 
 12:16:25 UTC (rev 95421)
 @@ -27,6 +27,8 @@
  from zope.container.interfaces import ISimpleReadContainer
  from zope.container.traversal import ContainerTraversable
  
 +from zope.app.folder import Folder, rootFolder
 +
  # XXX we would like to swap the names of the *PlacelessSetup classes
  # in here as that would seem to follow the convention better, but
  # unfortunately that would break compatibility with zope.app.testing
 @@ -69,3 +71,12 @@
  def tearDown(self, docttesttest=None):
  ContainerPlacelessSetup.tearDown(self)
  
 +
 +def buildFolders(self):
 +root = self.rootFolder = rootFolder()
 +root[u'folder1'] = Folder()
 +root[u'folder1'][u'folder1_1'] = Folder()
 +root[u'folder1'][u'folder1_1'][u'folder1_1_1'] = Folder()
 +root[u'folder2'] = Folder()
 +root[u'folder2'][u'folder2_1'] = Folder()
 +root[u'folder2'][u'folder2_1'][u'folder2_1_1'] = Folder()
 
 Modified: zope.container/trunk/src/zope/container/tests/test_objectcopier.py
 ===
 --- zope.container/trunk/src/zope/container/tests/test_objectcopier.py
 2009-01-29 12:15:45 UTC (rev 95420)
 +++ zope.container/trunk/src/zope/container/tests/test_objectcopier.py
 2009-01-29 12:16:25 UTC (rev 95421)
 @@ -24,9 +24,8 @@
  from zope.copypastemove import ObjectCopier
  from zope.copypastemove.interfaces import IObjectCopier
  
 -from zope.app.component.testing import PlacefulSetup
  from zope.container import testing
 -from zope.app.folder import Folder
 +from zope.app.folder import Folder, rootFolder

W!  zope.container is a new module, not in zope.app:  why are we
injecting a dependency on zope.app.folder here?  Logically,
zope.app.folder ought to depend on zope.container, and not vice versa.
We should be mocking those objects, I think.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJgeKs+gerLs4ltQ4RAvO3AKCte+I75UmOT1oH3xC6ZGAvlHmmPwCbBfHq
woTtEPPdKKKhVhM3nDb8epE=
=DTPu
-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] SVN: zope.container/trunk/ Remove zope.app.component dependency. Declare zope.app.dependable

2009-01-29 Thread Martijn Faassen
Tres Seaver wrote:

 W!  zope.container is a new module, not in zope.app:  why are we
 injecting a dependency on zope.app.folder here?  Logically,
 zope.app.folder ought to depend on zope.container, and not vice versa.
 We should be mocking those objects, I think.

One step at the time. Take a look again.

Regards,

Martijn

___
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] lovely.recipe.importchecker + py 2.5

2009-01-29 Thread Adam GROSZER
Hello,

Seems like lovely.recipe.importchecker fails on python 2.5 with:

  File 
/home/adi/.buildout/eggs/lovely.recipe-1.0.0a1-py2.5.egg/lovely/recipe/importchecker/importchecker.py,
 line 313, in main
db.findModules()
  File 
/home/adi/.buildout/eggs/lovely.recipe-1.0.0a1-py2.5.egg/lovely/recipe/importchecker/importchecker.py,
 line 223, in findModules
module = Module(modulepath)
  File 
/home/adi/.buildout/eggs/lovely.recipe-1.0.0a1-py2.5.egg/lovely/recipe/importchecker/importchecker.py,
 line 115, in __init__
self._map = findImports(mod)
  File 
/home/adi/.buildout/eggs/lovely.recipe-1.0.0a1-py2.5.egg/lovely/recipe/importchecker/importchecker.py,
 line 105, in findImports
compiler.walk(mod, visitor)
  File /usr/lib/python2.5/compiler/visitor.py, line 106, in walk
walker.preorder(tree, visitor)
  File /usr/lib/python2.5/compiler/visitor.py, line 63, in preorder
self.dispatch(tree, *args) # XXX *args make sense?
  File /usr/lib/python2.5/compiler/visitor.py, line 57, in dispatch
return meth(node, *args)
  File /usr/lib/python2.5/compiler/visitor.py, line 40, in default
self.dispatch(child, *args)
  File /usr/lib/python2.5/compiler/visitor.py, line 57, in dispatch
return meth(node, *args)
  File /usr/lib/python2.5/compiler/visitor.py, line 40, in default
self.dispatch(child, *args)
  File /usr/lib/python2.5/compiler/visitor.py, line 57, in dispatch
return meth(node, *args)
  File 
/home/adi/.buildout/eggs/lovely.recipe-1.0.0a1-py2.5.egg/lovely/recipe/importchecker/importchecker.py,
 line 70, in visitFrom
module_name, names = stmt.asList()
ValueError: too many values to unpack

Looks like stmt.asList() returns on python 2.5 a 3-tuple.
Anyone noticed that already?

-- 
Best regards,
 Adam GROSZER  mailto:agros...@gmail.com
--
Quote of the day:
Lawyers on opposite sides of a case are like the two parts of shears; they cut 
what comes between them, but not each other. 
- Daniel Webster 

___
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] SVN: zope.container/trunk/ Remove zope.app.component dependency. Declare zope.app.dependable

2009-01-29 Thread Stephan Richter
On Thursday 29 January 2009, Martijn Faassen wrote:
  W!  zope.container is a new module, not in zope.app:  why are we
  injecting a dependency on zope.app.folder here?  Logically,
  zope.app.folder ought to depend on zope.container, and not vice versa.
  We should be mocking those objects, I think.

 One step at the time. Take a look again.

I was about to write the same. ;-) Tres, let the guys finish their work and 
then we can bitch about it. ;-)

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
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] [Checkins] SVN: zope.app.cache/trunk/ use zope.container instead of zope.app.container

2009-01-29 Thread Stephan Richter
On Thursday 29 January 2009, Wolfgang Schnerring wrote:
 @@ -5,6 +5,8 @@
  3.4.2 (unreleased)
  --
  
 +- Use zope.container instead of zope.app.container.
 +

I think that changing a dependency like this, should cause a new major 
release, in this case 3.5.0. Changing the dependencies liek this could be 
considered a major feature. It also signalizes the users to look out for 
changes like this.

I am just trying to open up the discussion on this.

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
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] SVN: zope.app.cache/trunk/ use zope.container instead of zope.app.container

2009-01-29 Thread Martijn Faassen
Stephan Richter wrote:
 On Thursday 29 January 2009, Wolfgang Schnerring wrote:
 @@ -5,6 +5,8 @@
  3.4.2 (unreleased)
  --
  
 +- Use zope.container instead of zope.app.container.
 +
 
 I think that changing a dependency like this, should cause a new major 
 release, in this case 3.5.0. Changing the dependencies liek this could be 
 considered a major feature. It also signalizes the users to look out for 
 changes like this.
 
 I am just trying to open up the discussion on this.

We agree here, so we'll go back and do that.

Regards,

Martijn

___
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] zope.app.locales and the packages split

2009-01-29 Thread Martijn Faassen
Hi there,

We're currently updating references to zope.app.container to 
zope.container where appropriate. We just ran into zope.app.locales, 
which contains translations for various strings with the id 
zope.app.container.

The tool to update the zope.pot file is installed in bin/i18nextract. 
Unfortunately the documentation src/zope.app/locales/TRANSLATE.txt still 
talks about the single Zope 3 and I can't figure which commandline 
arguments to use to make it work for a package like zope.container. 
Should I even be updating these ids? I can leave those that reference 
zope.app.container.browser alone as we left that in its original place, 
but anything referencing zope.app.container itself might need an update.

For now, I'll leave this package alone.

Regards,

Martijn

___
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] dependency cleanup progress report

2009-01-29 Thread Martijn Faassen
Hi there,

After a lot of work we have progress to report on the dependency 
reduction front:

http://faassen.n--tree.net/blog/view/weblog/2009/01/29/0

It's been a lot of work to get this far and there's a huge amount of 
work to be done still, but there is progress!

The second dependency graph is against the trunks of all the packages, 
as we haven't done the releases yet to make this real. We will look into 
this tomorrow. We also need to document the various procedures we have 
been using to do this work so that others can jump in and help us.

Regards,

Martijn


___
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] dependency cleanup progress report

2009-01-29 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Martijn Faassen wrote:
 Hi there,
 
 After a lot of work we have progress to report on the dependency 
 reduction front:
 
 http://faassen.n--tree.net/blog/view/weblog/2009/01/29/0
 
 It's been a lot of work to get this far and there's a huge amount of 
 work to be done still, but there is progress!
 
 The second dependency graph is against the trunks of all the packages, 
 as we haven't done the releases yet to make this real. We will look into 
 this tomorrow. We also need to document the various procedures we have 
 been using to do this work so that others can jump in and help us.

Excellent work!

Looking at the zope.container graph:

- - The zope.publisher dependency is purely there for the 'traverser.py'
  module, which probably doesn't belong in zope.container at all:  it
  only imports interfaces to set up __adapts__, which suggests that it
  should be in zope.publisher, or some other package which depends on
  both (losing the __adapts__ wouldn't be terrible, for instance).

- - The dependency module pulls in zope.app.dependable:  I think it would
  make more sense to move the event subscriber *into* that package.
  which would remove the other, indirect dependency on zope.traversing.

- - The 'testing' module should lose all the zope-specific module-scope
  imports, even  if that means losing some convenience.

- - The 'contained' module has a bunch of dependencies, including a
  suspicous one on zope.app.broken:  if the IBroken check is really
  needed, then that interface should be moved to another package.

- - The zope.exceptions dependency, again from contained, is due to
  the use of a couple of dubious zope-specific exceptions:

  o UserError should probably be replaced with the standard ValueError.

  o DuplicationError should probably be replaced with KeyError.



Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJgjDu+gerLs4ltQ4RAtv4AJ902n6ZnbpoA3patMcW8H/93cAYeACeNoeR
3XSe5cO+WIcCHz2o/TtDZkc=
=6kKl
-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 )


[Zope-dev] zope.app.container -- zope.container

2009-01-29 Thread Wolfgang Schnerring
Hello,

we are holding a mini sprint at Marijn Faassen's place this week with
the main goal of reducing dependencies between Zope packages.
One result of this effort is that now the non-ZMI parts of
zope.app.container have been factored out into zope.container, and
only the ZMI-related bits (zope.app.container.browser) and
zope.app.container.interfaces.IAdding remain there.
(Martijn Faassen just blogged a visually appealing explanation of why
this was a Good Thing(tm) to do.)

We did this refactoring in a backwards-compatible way, so all symbols
can still be imported from their old location, and there are no
deprecation warnings, either, but still -- zope.app.container is
deprecated as of now (except of course for the .browser and IAdding
parts).

We've combed through (most of) svn.zope.org and updated referencing
packages accordingly, but if you find something that we've missed (or
import from zope.app.container in your own packages), please update it
at your convenience.
(Christian Theune will be adding import checking functionality to
zope.testing's testrunner that can aid in detecting moved imports,
this might be helpful for finding such things.)

Wolfgang
___
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] ZopeProfiler and Kcachegrind, how to convert statistics files ?

2009-01-29 Thread Jean-Michel FRANCOIS
Dieter Maurer a écrit :
 Jean-Michel FRANCOIS wrote at 2009-1-28 16:56 +0100:
   
 Is someone has try to use ZopeProfiler with KCacheGrind ? I would like
 to try KCachegrind because i found xdot very slow.

 I have started to read the code of ZopeProfiler and i have discovered
 the world of profiling file format. It seems that ZopeProfiler save it's
 file in pstats format. So i need to convert those file to calltree
 format. But all scripts i have tryed has failed:

 * pyprof2calltree
 * lsprofcalltree.py
 * hotshot2calltree

 So am i on the wrong way ? Do i need to fix one of these script ? Are
 you using on of them ?
 

 You could try pyprof2calltree from the Python interpreter in
 the following way:

 from marshal import load
 from pyprof2calltree import visualize # or convert
 stats = load(open(name_of_saved_file, 'rb'))
 visualize(stats)


 Not sure whether it will work (it probably will when pyprof2calltree does
 not expect a more modern 'pstats' format).



   
I have try this one. First issue, it assume you are using a Python2.5
(cProfile is new in Python2.5 but assume the same API) so i have change
the import

  import profile as cProfile

Now got a new problem when trying visualize:

 visualize(stats)
Traceback (most recent call last):
  File stdin, line 1, in ?   
  File
/home/toutpt/temp/profiling/lib/python2.4/site-packages/pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py,
line 256, in visualize
converter = CalltreeConverter(profiling_data)
  File
/home/toutpt/temp/profiling/lib/python2.4/site-packages/pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py,
line 117, in visualize
self.output(f)
  File
/home/toutpt/temp/profiling/lib/python2.4/site-packages/pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py,
line 104, in output
self._print_summary()
  File
/home/toutpt/temp/profiling/lib/python2.4/site-packages/pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py,
line 134, in _print_summary
print entry
AttributeError: 'tuple' object has no attribute 'totaltime'


___
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] ZopeProfiler and Kcachegrind, how to convert statistics files ?

2009-01-29 Thread Jean-Michel FRANCOIS
It's done, i m now able to use KCachegrind with ZopeProfiler. I have
patched pyprof2calltree to work with python2.4:


diff -U 3 -H -d -r -N --
pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py
pyprof2calltree-1.1.0-py2.4.egg.NEW//pyprof2calltree.py
--- pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py2008-12-21
19:14:42.0 +0100
+++ pyprof2calltree-1.1.0-py2.4.egg.NEW//pyprof2calltree.py   
2009-01-29 17:15:05.0 +0100
@@ -26,7 +26,18 @@
 take a previously recorded instance of the pstats.Stats class.
 
 
-import cProfile
+try:
+import cProfile
+except ImportError:
+#BBB for python2.4
+import profile as cProfile
+def label(code):
+if isinstance(code, str):
+return ('~', 0, code) # built-in functions ('~' sorts at
the end)
+else:
+return (code.co_filename, code.co_firstlineno, code.co_name)
+cProfile.label = label
+
 import pstats
 import optparse
 import os


But something don't work : the call_info variable is not a sequence but
a integer, so i have fixed it like that:

@@ -175,9 +186,9 @@
 print  out_file, 'cfn=%s %s:%d' % (
 co_name, co_filename, co_firstlineno)
 print  out_file, 'cfi=%s' % (co_filename,)
-print  out_file, 'calls=%d %d' % (call_info[0], co_firstlineno)
+print  out_file, 'calls=%d %d' % (call_info, co_firstlineno)
 
-totaltime = int(call_info[3] * 1000)
+totaltime = int(call_info * 1000)
 print  out_file, '%d %d' % (lineno, totaltime)
 
 def main():



Jean-Michel FRANCOIS a écrit :
 Dieter Maurer a écrit :
   
 Jean-Michel FRANCOIS wrote at 2009-1-28 16:56 +0100:
   
 
 Is someone has try to use ZopeProfiler with KCacheGrind ? I would like
 to try KCachegrind because i found xdot very slow.

 I have started to read the code of ZopeProfiler and i have discovered
 the world of profiling file format. It seems that ZopeProfiler save it's
 file in pstats format. So i need to convert those file to calltree
 format. But all scripts i have tryed has failed:

 * pyprof2calltree
 * lsprofcalltree.py
 * hotshot2calltree

 So am i on the wrong way ? Do i need to fix one of these script ? Are
 you using on of them ?
 
   
 You could try pyprof2calltree from the Python interpreter in
 the following way:

 from marshal import load
 from pyprof2calltree import visualize # or convert
 stats = load(open(name_of_saved_file, 'rb'))
 visualize(stats)


 Not sure whether it will work (it probably will when pyprof2calltree does
 not expect a more modern 'pstats' format).



   
 
 I have try this one. First issue, it assume you are using a Python2.5
 (cProfile is new in Python2.5 but assume the same API) so i have change
 the import

   import profile as cProfile

 Now got a new problem when trying visualize:

   
 visualize(stats)
 
 Traceback (most recent call last):
   File stdin, line 1, in ?   
   File
 /home/toutpt/temp/profiling/lib/python2.4/site-packages/pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py,
 line 256, in visualize
 converter = CalltreeConverter(profiling_data)
   File
 /home/toutpt/temp/profiling/lib/python2.4/site-packages/pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py,
 line 117, in visualize
 self.output(f)
   File
 /home/toutpt/temp/profiling/lib/python2.4/site-packages/pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py,
 line 104, in output
 self._print_summary()
   File
 /home/toutpt/temp/profiling/lib/python2.4/site-packages/pyprof2calltree-1.1.0-py2.4.egg/pyprof2calltree.py,
 line 134, in _print_summary
 print entry
 AttributeError: 'tuple' object has no attribute 'totaltime'


 ___
 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] Grant Opened for a PhD / Post-doc related to ZODB in Paris]

2009-01-29 Thread Vincent Pelletier
Hi,

Paris City and Paris Regional Governments are financing a grant for 
someone to do a PhD or a post-doc related to ZODB. The scientific topic 
is related to transaction management in ZODB and distributed 
environments, following the works of Adya's thesis.
  http://www.python.org/~jeremy/weblog/030514.html

There will also be some potential applications to ERP5 and Plone.

This grant is open for any nationality and is only based on scientific 
skills and motivations.

If you are interested, please contact Jean-Paul Smets j...@nexedi.com.

Regards,
--
Vincent Pelletier
___
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 )