Re: [Zope] unittest a component that is using zope.dublincore

2009-03-30 Thread Thierry Florac
Le samedi 28 mars 2009 à 15:46 +0100, Jean-Michel FRANCOIS a écrit :
 Hi,
   I m trying to make my first content type with zope3. The code is
 available there: http://github.com/toutpt/z3weblog.entry/tree
 
 I m following the second edition of the book web component developement
 with zope3, i know this is not the last edition. So, i m making a
 ISized component for my simple content type, with a simple unittest, but
 now, i want to use zope.dublincore package and i get an error when i m
 launch the tests:
 
 =
 (zope3apps)tou...@linux-tggd:~/workspace/zope3apps/apps/prout .bin/test
 Running tests at level 1
 Running unit tests:
   Running:
 ...
 
 Error in test test_size_for_display
 (z3weblog.entry.tests.test_size.EntrySizeTestCase)
 Traceback (most recent call last):
   File
 /home/toutpt/outils/python_system/2.5.4/lib/python2.5/unittest.py,
 line 260, in run
 testMethod()
   File
 /home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/tests/test_size.py,
 line 21, in test_size_for_display
 msg = self.size.sizeForDisplay()
   File
 /home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/size.py,
 line 24, in sizeForDisplay
 unit, chars = self.sizeForSorting()
   File
 /home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/size.py,
 line 18, in sizeForSorting
 dc = dcI.IZopeDublinCore(self.context)
 TypeError: ('Could not adapt', z3weblog.entry.content.ZODBWeblogEntry
 object at 0x839382c, InterfaceClass
 zope.dublincore.interfaces.IZopeDublinCore)
 
 .
 
 Error in test test_size_for_sorting
 (z3weblog.entry.tests.test_size.EntrySizeTestCase)
 Traceback (most recent call last):
   File
 /home/toutpt/outils/python_system/2.5.4/lib/python2.5/unittest.py,
 line 260, in run
 testMethod()
   File
 /home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/tests/test_size.py,
 line 16, in test_size_for_sorting
 unit, size = self.size.sizeForSorting()
   File
 /home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/size.py,
 line 18, in sizeForSorting
 dc = dcI.IZopeDublinCore(self.context)
 TypeError: ('Could not adapt', z3weblog.entry.content.ZODBWeblogEntry
 object at 0x839382c, InterfaceClass
 zope.dublincore.interfaces.IZopeDublinCore)
 
 
   Ran 4 tests with 0 failures and 2 errors in 0.007 seconds.
 
 Tests with errors:
test_size_for_display (z3weblog.entry.tests.test_size.EntrySizeTestCase)
test_size_for_sorting (z3weblog.entry.tests.test_size.EntrySizeTestCase)
 
 
 
 The trace back is very clear, the zope.dublincore components are not
 loaded. The question is : what is the best way to load components in
 unittests ? Do just i have to load the zcml of zope.dublincore, or do i
 have to register only needed components, if so how can i do that ?


You can also provide your own adapter and register it for your tests.
This example is extracted from zope.app.container unit tests :


from datetime import datetime
from zope.security import checker
from zope.dublincore.interfaces import IZopeDublinCore
from zope.app.testing import ztapi

class EntrySizeTestCase(unittest.TestCase):

def setUp(self):
class FauxDCAdapter(object):
implements(IZopeDublinCore)

__Security_checker__ = checker.Checker(
{created: zope.Public,
 modified: zope.Public,
 title: zope.Public,
 },
{title: zope.app.dublincore.change})

def __init__(self, context):
pass
title = 'faux title'
size = 1024
created = datetime(2001, 1, 1, 1, 1, 1)
modified = datetime(2002, 2, 2, 2, 2, 2)

ztapi.provideAdapter(IZODBWeblogEntry, IZopeDublinCore,
FauxDCAdapter)


Not tested anyway, but hope will help...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.flo...@onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope] How to add existing folder in Zope

2009-03-30 Thread Andrew Milton
+---[ Tim Nash ]--
|

[snip long story about noone paying attention to the actual requirements]

I notice none of them installed plone either.

-- 
Andrew Milton
a...@theinternet.com.au
___
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] Touching an object / updating the modification time

2009-03-30 Thread Paul Winkler
On Sat, Mar 28, 2009 at 01:02:58PM +0100, Jakob Schou Jensen wrote:
 Hi Paul,
 
 Doing a
 
some_image._p_changed = 1
 
 gives me an error:
 
_p_changed is an invalid attribute name because it starts with _.
 
 Do you know what I am doing wrong?

Ah, I didn't realize you are doing this in untrusted code.
http://docs.zope.org/zope2/zope2book/source/ScriptingZope.html#script-security

Another approach would be to just change any (small) attribute of the
object.  Something like: some_image.title = some_image.title


-- 

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


[Zope] SiteRoot Issues

2009-03-30 Thread Bobby

Hi,

I've created a SiteRoot to point to a subfolder of the root folder /subfolder. 
Now I can't get back to the root folder / or remove the SiteRoot entry. How do 
I get back to the / root folder or go back and edit/remove the SiteRoot entry 
that I've just did. I checked the Undo tab by my SiteRoot entry wasn't there. 
Thanks for any suggestions.




  
___
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] SiteRoot Issues

2009-03-30 Thread Andreas Jung
google zope removing siteroot

On Mon, Mar 30, 2009 at 11:32, Bobby cybercruis...@yahoo.com wrote:


 Hi,

 I've created a SiteRoot to point to a subfolder of the root folder
 /subfolder. Now I can't get back to the root folder / or remove the SiteRoot
 entry. How do I get back to the / root folder or go back and edit/remove the
 SiteRoot entry that I've just did. I checked the Undo tab by my SiteRoot
 entry wasn't there. Thanks for any suggestions.





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


Re: [Zope] SiteRoot Issues

2009-03-30 Thread Bobby

nvm, found the answer on google, will try VirtualHostMonster instead. 

_SUPPRESS_SITEROOT/manage


btw, am I on the wrong mailing list or something? Usually, the Zope community 
is very responsive but I haven't been getting any responses to my emails 
lately...Hell! Is anyone out there? Cam you guys see me? Earth to Zope, 
please give me some dope back if you see this :).  



--- On Mon, 3/30/09, Bobby cybercruis...@yahoo.com wrote:

 From: Bobby cybercruis...@yahoo.com
 Subject: [Zope] SiteRoot Issues
 To: zope@zope.org
 Date: Monday, March 30, 2009, 10:32 AM
 Hi,
 
 I've created a SiteRoot to point to a subfolder of the
 root folder /subfolder. Now I can't get back to the root
 folder / or remove the SiteRoot entry. How do I get back to
 the / root folder or go back and edit/remove the SiteRoot
 entry that I've just did. I checked the Undo
 tab by my SiteRoot entry wasn't there. Thanks for any
 suggestions.
 
 
 
 
   
 ___
 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-Checkins] SVN: Zope/trunk/alltests.cfg We really don't care about zodbcode

2009-03-30 Thread Hanno Schlichting
Log message for revision 98655:
  We really don't care about zodbcode
  

Changed:
  U   Zope/trunk/alltests.cfg

-=-
Modified: Zope/trunk/alltests.cfg
===
--- Zope/trunk/alltests.cfg 2009-03-30 22:56:33 UTC (rev 98654)
+++ Zope/trunk/alltests.cfg 2009-03-30 23:24:03 UTC (rev 98655)
@@ -16,7 +16,6 @@
 RestrictedPython
 tempstorage
 zLOG
-zodbcode
 zope.annotation
 zope.broken
 zope.browser

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


Re: [Zope-dev] trying out the buildout-based Zope 2.12...

2009-03-30 Thread Jim Fulton

On Mar 29, 2009, at 4:10 PM, Wichert Akkerman wrote:
...
 You can compare this with dpkg and apt on Debian and Ubuntu systems:
 dpkg is the lower level install that installs one or more packages. It
 only checks if the packages you install break any package conflicts
 and if their dependencies are met. It is simpler than easy_install: it
 will not look for or download packages itself. Python does not have a
 such a low level tool

Yes it does, the setup install command.

Jim

--
Jim Fulton
Zope Corporation


___
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] trying out the buildout-based Zope 2.12...

2009-03-30 Thread Wichert Akkerman
On 3/30/09 4:04 PM, Jim Fulton wrote:

 On Mar 29, 2009, at 4:10 PM, Wichert Akkerman wrote:
 ...
 You can compare this with dpkg and apt on Debian and Ubuntu systems:
 dpkg is the lower level install that installs one or more packages. It
 only checks if the packages you install break any package conflicts
 and if their dependencies are met. It is simpler than easy_install: it
 will not look for or download packages itself. Python does not have a
 such a low level tool

 Yes it does, the setup install command.

That's not quite the same. If you give someone a .egg, .zip or a .tar.gz 
file they can't install it with a single command. For an egg you will 
need easy_install, for the other two it is a two step process of 
unpacking and calling setup.py.

Wichert.

___
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] ZEO for Zope 2.12.0a1 from buildout with no funky recipes ; -)

2009-03-30 Thread Chris Withers
Hi,

Well, I made some progress in that ZEO instances are just fine to get going.

Here's the buildout.cfg:

[buildout]
parts = zeoinstance
extends = versions2.cfg

[zeoinstance]
recipe = zc.recipe.egg
eggs =
   ZODB3
entry-points=
   runzeo=ZEO.runzeo:main
   zeoctl=ZEO.zeoctl:main
   zdrun=zdaemon.zdrun:main
scripts = runzeo zeoctl zdrun
initialization =
   import sys
   sys.argv[1:1] = ['-C','${buildout:directory}/etc/zeo.conf']

... with versions2.cfg and versions3.cfg coming from the same source as 
my previous zope instance attempt, and here's the zeo.conf:

%define INSTANCE .

zeo
   address 2000
/zeo

filestorage 1
   path $INSTANCE/var/Data.fs
/filestorage

eventlog
   level info
   logfile
 path $INSTANCE/log/zeo.log
   /logfile
/eventlog

runner
   program $INSTANCE/bin/runzeo
   daemon true
   forever false
   backoff-limit 10
   exit-codes 0, 2
   directory $INSTANCE
   default-to-interactive true
   zdrun $INSTANCE/bin/zdrun
   logfile $INSTANCE/log/zdrun.log
/runner

Now, one question I had was how to get $INSTANCE to be set to where the 
buildout.cfg is, rather than having it hardcoded to '.'?

'.' works just fine, provided you run the control scripts from within 
the buildout directory, but I don't know how to do that from cron.

So, two ideas:

- can ZConfig take stuff from the environment?
   (who maintains ZConfig now?)

- Hanno, what was that stuff you mentioned?

cheers,

Chris
___
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] trying out the buildout-based Zope 2.12...

2009-03-30 Thread Paul Winkler
On Sun, Mar 29, 2009 at 11:47:14AM -0400, Jim Fulton wrote:
 I think an implementation of a better dependency resolution strategy in
 buildout would be a good place to start.  I think some limited  
 backtracking could go a long way. Anyone interested in working on this?

Ian's Pip tool tries to download everything and work out the complete
graph before doing any installation; I've no idea if any of that work
could be ported to buildout, but it might be worth a look?
https://svn.openplans.org/svn/pip/

(If you guys are both still at Pycon, might be worth a face-to-face
chat...)

-- 

Paul Winkler
http://www.slinkp.com
___
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] trying out the buildout-based Zope 2.12...

2009-03-30 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 30.03.2009 11:08 Uhr, Paul Winkler wrote:
 On Sun, Mar 29, 2009 at 11:47:14AM -0400, Jim Fulton wrote:
 I think an implementation of a better dependency resolution strategy in
 buildout would be a good place to start.  I think some limited  
 backtracking could go a long way. Anyone interested in working on this?
 
 Ian's Pip tool tries to download everything and work out the complete
 graph before doing any installation; I've no idea if any of that work
 could be ported to buildout, but it might be worth a look?
 https://svn.openplans.org/svn/pip/
 
 (If you guys are both still at Pycon, might be worth a face-to-face
 chat...)


We resolved parts of the problem at PyCon yesterday but we need to
follow the Zope 3 approach and provide dedicated index page with
links to the pinned packages for use with easy_install.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknQ7vsACgkQCJIWIbr9KYz0IgCgwfy5K/r/wNYZnr9TMEaCr0V3
RQwAn0lQER/OFLnTApOtF1E85+6UcKrw
=AuCI
-END PGP SIGNATURE-
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd.  Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:i...@zopyx.com
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

___
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] trying out the buildout-based Zope 2.12...

2009-03-30 Thread Jim Fulton

On Mar 30, 2009, at 12:08 PM, Paul Winkler wrote:

 On Sun, Mar 29, 2009 at 11:47:14AM -0400, Jim Fulton wrote:
 I think an implementation of a better dependency resolution  
 strategy in
 buildout would be a good place to start.  I think some limited
 backtracking could go a long way. Anyone interested in working on  
 this?

 Ian's Pip tool tries to download everything and work out the complete
 graph before doing any installation; I've no idea if any of that work
 could be ported to buildout, but it might be worth a look?
 https://svn.openplans.org/svn/pip/

But this is about determining the complete graph.

Jim

--
Jim Fulton
Zope Corporation


___
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] trying out the buildout-based Zope 2.12...

2009-03-30 Thread Paul Winkler
On Mon, Mar 30, 2009 at 12:29:16PM -0400, Jim Fulton wrote:
 On Mar 30, 2009, at 12:08 PM, Paul Winkler wrote:
 Ian's Pip tool tries to download everything and work out the complete
 graph before doing any installation; I've no idea if any of that work
 could be ported to buildout, but it might be worth a look?
 https://svn.openplans.org/svn/pip/

 But this is about determining the complete graph.

I don't understand. What did I say that wasn't relevant to that?

-- 

Paul Winkler
http://www.slinkp.com
___
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 and Cygwin

2009-03-30 Thread Cesar Canassa
It would be possible to modify the plonectl script in order to make it run
without using the zdaemon? Similar to way that the runzope used to work.

I am using the Plone unified installer, it doesn't comes with the runzope
script.

Thanks,
Cesar

2009/3/29 Dieter Maurer die...@handshake.de

 Cesar Canassa wrote at 2009-3-27 19:56 -0300:
 Does Zope requires that a root user should exist on system in order to
 run
 properly? I am asking this because when I try to run Zope as a daemon I
 got
 this:
 
 $ ./plonectl start
 instance: . . . . . . . . . . . . . . . . . . . Unlinking stale socket
 /cygdrive/c/Cygwin/home/ccanassa/Plone/zinstance/var/instance/zopectlsock;
 sleep 1
 
 No handlers could be found for logger root
 . Unlinking stale socket
 /cygdrive/c/Cygwin/home/ccanassa/Plone/zinstance/var/instance/zopectlsock;
 sleep 1
 . Unlinking stale socket

 The continued Unlinking stale socket means that your zdaemon is dieing.


 zdaemon is not supposed to work under Windows.

 I am unsure whether this also includes Cygwin on Windows.
 Your observation may indicate that it actually does


 Try to configure logging for your zdaemon and look into its logfile.
 If this does not reveal hints, modify the zdaemon code to ensure
 that problems are logged to a file you know.


 --
 Dieter

___
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] Buildbot for Zope 3

2009-03-30 Thread Sebastien Douche
Hi,
sad time for zope 3:
http://zope.buildbot.securactive.org/waterfall

Tell me if you other things (I want repoze, python and Tarek's distutils).

-- 
Sebastien Douche sdou...@gmail.com
___
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] snakebite

2009-03-30 Thread Martijn Faassen
Hey,

On Mon, Mar 23, 2009 at 4:46 AM, Adam GROSZER agros...@gmail.com wrote:
 Any chance on beating on this? Or somewhere else to have a buildbot
 slave on win32?

 Just touched zc.buildout trunk and it seems to fail miserably on
 win32.

Hey, I'd be very happy is someone took the initiative of contacting
the snakebite people and getting it going. Please volunteer and get
talking on the snakebite mailing list.

If you need to contact Titus Brown who I believe is involved in this,
I know him a little, and I can involve him in the discussion.

But we need one or more volunteers to push this.

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 )