[Zope-Checkins] CVS: Zope/lib/python/nt_svcutils - service.py:1.1.2.6

2005-06-20 Thread Tim Peters
Update of /cvs-repository/Zope/lib/python/nt_svcutils
In directory cvs.zope.org:/tmp/cvs-serv5742/lib/python/nt_svcutils

Modified Files:
  Tag: Zope-2_7-branch
service.py 
Log Message:
Shut down cleanly when Windows is shutting down.


=== Zope/lib/python/nt_svcutils/service.py 1.1.2.5 = 1.1.2.6 ===
--- Zope/lib/python/nt_svcutils/service.py:1.1.2.5  Wed Jun  8 11:33:21 2005
+++ Zope/lib/python/nt_svcutils/service.py  Mon Jun 20 16:43:37 2005
@@ -85,6 +85,11 @@
 # Set the stop event - the main loop takes care of termination.
 win32event.SetEvent(self.hWaitStop)
 
+# SvcStop only gets triggered when the user explictly stops (or restarts)
+# the service.  To shut the service down cleanly when Windows is shutting
+# down, we also need to hook SvcShutdown.
+SvcShutdown = SvcStop
+
 def onStop(self):
 # A hook for subclasses to override
 pass

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


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/nt_svcutils/service.py Port from 2.7 branch.

2005-06-20 Thread Tim Peters
Log message for revision 30868:
  Port from 2.7 branch.
  
  Shut down cleanly when Windows is shutting down.
  

Changed:
  U   Zope/branches/Zope-2_8-branch/lib/python/nt_svcutils/service.py

-=-
Modified: Zope/branches/Zope-2_8-branch/lib/python/nt_svcutils/service.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/nt_svcutils/service.py 
2005-06-20 19:52:19 UTC (rev 30867)
+++ Zope/branches/Zope-2_8-branch/lib/python/nt_svcutils/service.py 
2005-06-20 20:46:59 UTC (rev 30868)
@@ -85,6 +85,11 @@
 # Set the stop event - the main loop takes care of termination.
 win32event.SetEvent(self.hWaitStop)
 
+# SvcStop only gets triggered when the user explictly stops (or restarts)
+# the service.  To shut the service down cleanly when Windows is shutting
+# down, we also need to hook SvcShutdown.
+SvcShutdown = SvcStop
+
 def onStop(self):
 # A hook for subclasses to override
 pass

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/nt_svcutils/service.py Merge rev 30868 from 2.8 branch.

2005-06-20 Thread Tim Peters
Log message for revision 30869:
  Merge rev 30868 from 2.8 branch.
  
  Port from 2.7 branch.
  
  Shut down cleanly when Windows is shutting down.
  

Changed:
  U   Zope/trunk/lib/python/nt_svcutils/service.py

-=-
Modified: Zope/trunk/lib/python/nt_svcutils/service.py
===
--- Zope/trunk/lib/python/nt_svcutils/service.py2005-06-20 20:46:59 UTC 
(rev 30868)
+++ Zope/trunk/lib/python/nt_svcutils/service.py2005-06-20 20:49:44 UTC 
(rev 30869)
@@ -85,6 +85,11 @@
 # Set the stop event - the main loop takes care of termination.
 win32event.SetEvent(self.hWaitStop)
 
+# SvcStop only gets triggered when the user explictly stops (or restarts)
+# the service.  To shut the service down cleanly when Windows is shutting
+# down, we also need to hook SvcShutdown.
+SvcShutdown = SvcStop
+
 def onStop(self):
 # A hook for subclasses to override
 pass

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


[Zope-dev] Re: [Z3lab] Zope Corporation's Initial Reaction on the ZF Comments

2005-06-20 Thread Martijn Faassen

Hadar Pedhazur wrote:
[clarifications and opinions]

Hey,

I just wanted to chip in that:

* I'm very happy a foundation has been announced. This is what I and 
others advocated for, starting in earnest after the castle sprint last 
year. This is a major step in the right direction. Thank you Zope 
Corporation! I also wish to thank Nuxeo in their active role in taking 
this further.


Some points I think we all agree on:

* We all agree that the Foundation should be vendor-neutral. Those of us 
in business, we're competing and cooperating at the same time, and the 
Foundation will need to be on the balance.


* We all agree that the Foundation should be about more than just 
vendors. To those of us who are independent, the Foundation needs to 
listen to their voice as well, not just the vendors. We have extremely 
significant contributors in the community who are vendor neutral. I need 
to mention only the authors of the two Zope 3 books currently published.


Now on a more personal note:

* I am confident that Zope Corporation will do the right thing. Time and 
time again I've found that Zope Corporation does listen. Let's all not 
forget this.


* From my perspective as a company co-owner: the Foundation should be 
vendor-friendly. We should accept that one of the reasons it exists is 
to help vendors sell Zope better. (its future is assured in a 
foundation with N members). This self interest is fine, as long as we 
can all cooperate in a fair way. (a state of self-interested cooperation 
is ideal, I'd say, in fact)


* It's important for all parties involved to reach clarity about the 
relationship of the Zope Foundation with existing foundations and 
initiatives within the Zope community. We dont want uncertainty and 
confusion and we want to *stimulate* initiatives by the community. The 
community is after all one of our greatest resources.


* From my perspective as a developer: I hope politics won't get into the 
way of development too much. We'll inevitably and necessarily have 
politics in the period leading up to the creation of the Foundation, to 
ensure everybody's interests are being looked after. We'll have some 
more after the Foundation has been formed. Let's try to stay out of the 
developers' hair. Many of them don't want to be involved in politics or 
cannot be on a personal basis as they work for a company. We don't want 
them worried or pressurized by all of this. Again, the community is one 
of our greatest resources.


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] Re: Zope 2.9 goals

2005-06-20 Thread Martijn Faassen

Lennart Regebro wrote:

OK, so becuase of the tomembased release schedule, let's not dicuss
what goes in 2.9. let's discuss what features we found most
urgent/desirable, so we can start working on that, like now.


I think it's fine to discuss what we want to be in Zope 2.9. This way we 
can plan for it to actually be there.


We just should realize that if nobody does the work in time, it won't 
actually be in there, but that should only get the pressure up. The hope 
is that a time-based schedule will actually speed up feature 
development, not slow it down.


But you're right, work should start soon. This is also why I started the 
discussion now.


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] Re: Zope 2.9 goals

2005-06-20 Thread Chris McDonough
As I mentioned before, I'd like to see Christian's blob work make it
into 2.9.  So that's one feature. ;-)

On Mon, 2005-06-20 at 09:55 +0200, Martijn Faassen wrote:
 Lennart Regebro wrote:
  OK, so becuase of the tomembased release schedule, let's not dicuss
  what goes in 2.9. let's discuss what features we found most
  urgent/desirable, so we can start working on that, like now.
 
 I think it's fine to discuss what we want to be in Zope 2.9. This way we 
 can plan for it to actually be there.
 
 We just should realize that if nobody does the work in time, it won't 
 actually be in there, but that should only get the pressure up. The hope 
 is that a time-based schedule will actually speed up feature 
 development, not slow it down.
 
 But you're right, work should start soon. This is also why I started the 
 discussion now.
 
 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 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: [Z3lab] Zope Corporation's Initial Reaction on the ZF Comments

2005-06-20 Thread piero . goletto

Hi everybody,

Martin Faassen wrote:


* I'm very happy a foundation has been announced.

Me too, and I am grateful to Zope Corp. for that.



* We all agree that the Foundation should be about more than just
vendors [...] We have extremely significant contributors in the community
[...]

It makes sense to have also _users_ (people who use Zope but who doesn't

contribute any code to the code base): we need help from the users to meet
their needs.

In my opinion Zope Corp. is company in which many people are very clever.

* From my perspective as a company co-owner: the Foundation should be
vendor-friendly.

One of the reason that Zope Foundation exists is to support Zope vendors
and other communities who use Zope as a technological basis (such as
Plone, Nuxeo etc.)


* It's important for all parties involved to reach clarity about the
relationship of the Zope Foundation with existing foundations and
initiatives within the Zope community.

It's also important to define how existing foundations (such as Plone 
Foundation,
for instance), may cooperate with Zope Foundation.


Regards

Piero Giuseppe Goletto


___
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] ZOBD and pointers

2005-06-20 Thread Yair Benita
Hi All,

As my ZODB data files become larger and larger I am looking at ways to make
the structure of my objects more efficient. To simplify my question, suppose
I have two different classes and both contain a list of a objects from a
third class:

class x has the attribute x.elements = [objects of class z]
class y has the attribute y.elements = [objects of class z]

As far as I understand python the lists x.elements and y.elements contain
pointers to the z objects previously defined. What I wanted to know is how
ZODB handles that (or maybe I should say: how pickle handles that) when
saving to a file. Will the pointers be converted to a copy of the z class
objects or will one copy of the z class objects be saved and than the
x.elements and y.elements will still be a list of pointers?

Thanks for the help,
Yair
-- 
Yair Benita
Utrecht University
The Netherlands



___
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: ZOBD and pointers

2005-06-20 Thread Laurence Rowe
As far as I am aware, ZODB will store a list of pointers to the lists of 
z objects. What you should be careful of for efficient use of ZODB is 
that your list is stored in an efficient way, well if the list is 
updated often or long anyway.


When you pack your ZODB does it take up a lot less space? If so it may 
be that a lot of space is being wasted storing the updated lists of 
object references. Unless you use a special PersistentList ZODB will 
have no choice but to store a new copy of the whole list when that list 
is modified. If you have long lists then this can be a big problem. The 
Persistent classes have special handling to make them more efficent.


So instead of lists use PersistentLists and instead of dicts use BTrees, 
as these may be stored more efficiently in the ZODB.


Also have a look at the analyze.py script to try and track down where 
the space is being used. My notes here may be helpful too 
http://zopelabs.com/cookbook/1114086617


Hope that helps,

Laurence

Yair Benita wrote:

Hi All,

As my ZODB data files become larger and larger I am looking at ways to make
the structure of my objects more efficient. To simplify my question, suppose
I have two different classes and both contain a list of a objects from a
third class:

class x has the attribute x.elements = [objects of class z]
class y has the attribute y.elements = [objects of class z]

As far as I understand python the lists x.elements and y.elements contain
pointers to the z objects previously defined. What I wanted to know is how
ZODB handles that (or maybe I should say: how pickle handles that) when
saving to a file. Will the pointers be converted to a copy of the z class
objects or will one copy of the z class objects be saved and than the
x.elements and y.elements will still be a list of pointers?

Thanks for the help,
Yair


___
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] ZOBD and pointers

2005-06-20 Thread Tim Peters
[Yair Benita]
 ...  suppose I have two different classes and both contain a list of a objects
 from a third class:

 class x has the attribute x.elements = [objects of class z]
 class y has the attribute y.elements = [objects of class z]

 As far as I understand python the lists x.elements and y.elements contain
 pointers to the z objects previously defined.

Yes, Python lists always contain pointers -- even if it's a list of
integers, the list actually contains pointers to integer objects.  But
since that's always true, it's not much help in answering your real
question.  In general, pointers make sense only so long as an object
resides in memory.

 What I wanted to know is how ZODB handles that (or maybe I should say:
 how pickle handles that) when saving to a file. Will the pointers be converted
 to a copy of the z class objects or will one copy of the z class objects be
 saved and than the x.elements and y.elements will still be a list of pointers?

Persistence has its own rules:  if an object is persistent (an
instance of a subclass of Persistent|), then its current state is
stored uniquely in the database, and all references to it just save
away (in effect) its persistent object id (oid, usually a 64-bit
identifier uniquely assigned to each persistent object, and which
retains its value for as long as the database exists).  There are no
exceptions to this for persistent objects.  Oids are effectively a
mechanism for building persistent pointers, and apply only to
persistent objects.

If an object is not persistent (is not an instance of a subclass of
Persistent), it doesn't have an oid, and then there's very little
possibility to share references to it on disk.  Instead, on disk a
copy of its state will usually get made everywhere it's referenced.

So the answer to your specific question depends mostly on something
you didn't reveal:  does class z derive from Persistent?  If it does,
then _every_ reference on disk to an instance z1 is via z1's oid.  If
z doesn't derive from Perisistent, then almost all references on disk
to an instance z1 will be via a physically distinct copy of z1's full
state.
___
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: ZOBD and pointers

2005-06-20 Thread Tim Peters
[Laurence Rowe]
 ...
 Unless you use a special PersistentList ZODB will have no choice but
 to store a new copy of the whole list when that list is modified.

Caution:  that's true of a PersistentList too.  The purpose of
PersistentList isn't realy to supply more-effecient storage (that's
the purpose of the various BTree classes).  The purpose of
PersistentList is this:

myobject.my_list_attibute[3] = 4

If my_list_attribute is a plain Python list, the persistence machinery
has no way to know that my_list_attribute's state mutated, so the
assignment above will not get stored to disk at the next commit unless
you _also_ do

myobject._p_changed = True # or 1

If my_list_attribute is a PersistentList, then the persistence
machinery does know when its state mutates, and there's no need to
manage _p_changed manually.

But in either case, the entire state of my_list_attribute gets stored
to disk whenever any part of it changes.  The only difference in what
gets stored in the example above is that myobject's state also gets
stored to disk if my_list_attribute is a Python list (assuming
myobject._p_changed gets set to a true value by hand), while
myobject's state does not need to get written to disk again if
my_list_attribute is a PersistentList (then myobject refers to
my_list_attribute via the latter's oid, and that oid hasn't changed,
so there's no need to store myobject's state again).  The entire state
of the list attribute gets written out in either case.

 If you have long lists then this can be a big problem.

Very true.

 The Persistent classes have special handling to make them more efficent.

Sometimes true, but not in the PersistentList case.

 So instead of lists use PersistentLists

If the goal is to save space, generally no, PersistentList won't help
that; to the contrary, their state takes a little more space on disk
than a plain list.

 and instead of dicts use BTrees,

That one's differenent:  a BTree is really a graph of (potentially
_very_) many distinct perisistent objects, and BTrees were designed to
support space- and time- efficient mutation.

 as these may be stored more efficiently in the ZODB.

For BTrees, yes.
___
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] ZOBD and pointers

2005-06-20 Thread Yair Benita

As always. Clear, detailed and to the point. Thanks Tim.
Actually, the z class isn't a subclass of persistent because it just  
holds data (has no methods) and never changes. Same goes to the lists  
of x and y, they tend to hold a few elements and also never change.  
The X and Y classes are more complex and are stored using BTrees.
Reading this answer I understand that anything I store should be  
persistent, even if its a list I don't plan to edit. I was under the  
impression that a subclass of persistent will be larger in size for  
storage, so I avoided it in the cases mentioned. Is this true?


Thanks again for the help,
Yair


On Jun 20, 2005, at 4:00 , Tim Peters wrote:


[Yair Benita]

...  suppose I have two different classes and both contain a list  
of a objects

from a third class:

class x has the attribute x.elements = [objects of class z]
class y has the attribute y.elements = [objects of class z]

As far as I understand python the lists x.elements and y.elements  
contain

pointers to the z objects previously defined.



Yes, Python lists always contain pointers -- even if it's a list of
integers, the list actually contains pointers to integer objects.  But
since that's always true, it's not much help in answering your real
question.  In general, pointers make sense only so long as an object
resides in memory.


What I wanted to know is how ZODB handles that (or maybe I should  
say:
how pickle handles that) when saving to a file. Will the pointers  
be converted
to a copy of the z class objects or will one copy of the z class  
objects be
saved and than the x.elements and y.elements will still be a list  
of pointers?




Persistence has its own rules:  if an object is persistent (an
instance of a subclass of Persistent|), then its current state is
stored uniquely in the database, and all references to it just save
away (in effect) its persistent object id (oid, usually a 64-bit
identifier uniquely assigned to each persistent object, and which
retains its value for as long as the database exists).  There are no
exceptions to this for persistent objects.  Oids are effectively a
mechanism for building persistent pointers, and apply only to
persistent objects.

If an object is not persistent (is not an instance of a subclass of
Persistent), it doesn't have an oid, and then there's very little
possibility to share references to it on disk.  Instead, on disk a
copy of its state will usually get made everywhere it's referenced.

So the answer to your specific question depends mostly on something
you didn't reveal:  does class z derive from Persistent?  If it does,
then _every_ reference on disk to an instance z1 is via z1's oid.  If
z doesn't derive from Perisistent, then almost all references on disk
to an instance z1 will be via a physically distinct copy of z1's full
state.



___
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] ZOBD and pointers

2005-06-20 Thread Tim Peters
[Yair Benita]
 ...
 Reading this answer I understand that anything I store should be
 persistent, even if its a list I don't plan to edit.

I wouldn't say that.  For example, for _most_ applications it would be
foolish to create a subclass of Persistent to store an integer, as
opposed to just storing an integer directly.  I can conceive of
(unlikely!) applications where there may be advantages to storing
integers as perisistent objects, though.  In the same vein, if there
aren't multiple references to a single small list that doesn't change,
there seems little (if any) point to making that a PersistentList.

Note that there are other tradeoffs here too.  For example, an
attribute whose value is persistent is not loaded into RAM when its
parent is loaded into RAM, but the full state of non-persistent
attributes is loaded into RAM at the time their parent is loaded into
RAM.  That can have a major effect on time and memory demands, and in
opposing directions.  Or it may not -- it depends on details of the
application's object access patterns.

 I was under the impression that a subclass of persistent will be larger in 
 size
 for storage, so I avoided it in the cases mentioned. Is this true?

Create a specific class definition, and it's easy to measure.  It
depends on the class.  Certainly it costs more space to create a
persistent version of a builtin Python type, and for the same reason
it costs more space too to create any user-defined subclass of a
builtin Python type.  But for an object of a user-defined class, a
persistent version takes more RAM when it's in memory (because it has
to store info like the oid, and _p_changed, that non-persistent
objects don't have), but the on-disk size is at worst roughly the same
(e.g., the values of persistent attributes like _p_changed and
_p_state don't get stored to disk, they only exist while the
persistent object is in RAM).

If I were you, I'd spend some quality time with fsdump, and figure out
where the bulk of your space is going.  Details matter more than
general principles here.  If you use the fsdump.py from ZODB 3.4
(which can be used with .fs files created by ZODB 3.1 and 3.2 too), it
displays the byte size of data records, which can be a real help in
such analysis.
___
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: ZOBD and pointers

2005-06-20 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim Peters wrote:
 [Yair Benita]
 
...
Reading this answer I understand that anything I store should be
persistent, even if its a list I don't plan to edit.
 
 
 I wouldn't say that.  For example, for _most_ applications it would be
 foolish to create a subclass of Persistent to store an integer, as
 opposed to just storing an integer directly.  I can conceive of
 (unlikely!) applications where there may be advantages to storing
 integers as perisistent objects, though.

As, for instance, where the integer changes much more frequently than
the other attributes, which are large enough that re-storing them just
because the integer attribute changed is painful.  Making the attribute
a persistent sub-object also eliminates the chance of a ConflictError
based on changes to the other attributes.  This is the use case which
drives BTrees.Length, right?


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

iD8DBQFCtw/D+gerLs4ltQ4RAnEqAJ9PKCCRriJR3Qt4AWrGCUGk1V6RFQCgxTEl
9waizE6T/pk8Tz/Tkul/4TA=
=Uief
-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] FW: [Zope-Annce] Zope Foundation ideas

2005-06-20 Thread Hadar Pedhazur
FYI, for the few of you who may not actually listen to the
bigger lists ;-) 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rob Page
Sent: Monday, June 20, 2005 5:54 PM
To: zope@zope.org; zope-announce@zope.org
Subject: [Zope-Annce] Zope Foundation ideas

In preparation for tomorrow's IRC session (reminder/details
below) we have prepared some initial ideas about the Zope
Foundation.  These are available online at:

o http://tinyurl.com/74pd3

Note -- the document is written with phrases like the Foundation
will, Contributors shall, etc.  This is NOT to be interpreted
as though these terms/conditions are predetermined.  It is
written to close in on specific language that avoids
misinterpretation.

Zope Foundation IRC Session
---

IRC Session Summary:

   - Who:  Zope Corp and Zope Community
   - What: IRC session to discuss the Zope Foundation
   - When: Tue, 21 Jun 2005 10a - 12p (US EDT)
   - Where: irc.freenode.net #zope

Please send specific questions to:

   mailto:[EMAIL PROTECTED]

Hope to see you there.

Regards,
Rob

-- 

Rob PageV: 540.361.1710
Zope CorporationF: 703.995.0412

___
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] developing with zmi: how to move a patch from data from devel to live?

2005-06-20 Thread gabor

hi,

my problem is the following...

imagine that you develop something for the customer using zope.
while developing you use the ZMI a lot... to set some settings, to 
create python scripts and so on. you do this on the 'devel' server.


then you deliver the solution to the customer (to the 'live' server).
you can simply copy the data.fs stuff to the live server.

after some time the either customer wants some new features, or there's 
a bug to fix or something like that.


now you create the fix/improvement on the devel server.

but now how do you move the improvement/fix to the live server?
you cannot just copy the data.fs over. the customer already has some 
content/data in it...



one way seems to be to not use the ZMI at all. you create an install 
python script, which calls the methods of the ZMI interface. this way 
works, but it seems for me to waste my time. finding the right method 
that the gui calls to call it from the install script seems stupid for me.


but it solves the problem. with the script i can really make the changes 
i need on the devel server.


so, is there a solution where i can use the ZMI?

how do you solve this kind of problem?

gabor
___
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] developing with zmi: how to move a patch from data fro m devel to live?

2005-06-20 Thread Pascal Peregrina
You can manually export objects from your dev zope to individual files and
then import them back to the live instance through ZMI.

You could try this : http://zsyncer.sourceforge.net/
It will enable you, for built-in Zope object types (but then you can extend
it with your own types) to list the differences between your dev and live
zope instances and deploy your changes.

Pascal


-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de
gabor
Envoyé : lundi 20 juin 2005 08:35
À : zope@zope.org
Objet : [Zope] developing with zmi: how to move a patch from data from
devel to live?


hi,

my problem is the following...

imagine that you develop something for the customer using zope.
while developing you use the ZMI a lot... to set some settings, to 
create python scripts and so on. you do this on the 'devel' server.

then you deliver the solution to the customer (to the 'live' server).
you can simply copy the data.fs stuff to the live server.

after some time the either customer wants some new features, or there's 
a bug to fix or something like that.

now you create the fix/improvement on the devel server.

but now how do you move the improvement/fix to the live server?
you cannot just copy the data.fs over. the customer already has some 
content/data in it...


one way seems to be to not use the ZMI at all. you create an install 
python script, which calls the methods of the ZMI interface. this way 
works, but it seems for me to waste my time. finding the right method 
that the gui calls to call it from the install script seems stupid for me.

but it solves the problem. with the script i can really make the changes 
i need on the devel server.

so, is there a solution where i can use the ZMI?

how do you solve this kind of problem?

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


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.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 )


Re: [Zope] automagic reindexing of objects

2005-06-20 Thread Jürgen Herrmann

[ Dieter Maurer wrote:]
 Jürgen Herrmann wrote at 2005-6-17 14:19 +0200:
i make heavy use of indexes in my extension classes. these all inherit
from catalogpathaware, so i have to call object.reindex_object() on
each changed instance. calling it from attribute getters/setters f.ex.
is not a good idea, because changing 3 attributes will reindex the object
3 times.

what i'd like to have is that such objects are reindexed automatically
before comitting a transaction.

is it possible? where should i start looking in the source, is there
possibly a before_transaction_commit hook?

 It is impossible with ZODB 3.2 (unless you patch
 ZODB.Transaction.Transaction).

 ZODB 3.4 (which is used for Zope 2.8/3.1) has hooks
 that makes it possible.

 --
 Dieter

that's what i wanted to hear, thanks!
i'll have a look at zope 2.8 immediately :)

regards, juergen herrmann
___

 XLhost.de - eXperts in Linux hosting 

Juergen Herrmann
Weiherweg 10, 93051 Regensburg, Germany
Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027

ICQ:  27139974  -  IRC: [EMAIL PROTECTED]
WEB:  http://www.XLhost.de
___
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] developing with zmi: how to move a patch from data from devel to live?

2005-06-20 Thread Jens Vagelpohl


On 20 Jun 2005, at 07:35, gabor wrote:

now you create the fix/improvement on the devel server.

but now how do you move the improvement/fix to the live server?
you cannot just copy the data.fs over. the customer already has  
some content/data in it...



one way seems to be to not use the ZMI at all. you create an  
install python script, which calls the methods of the ZMI  
interface. this way works, but it seems for me to waste my time.  
finding the right method that the gui calls to call it from the  
install script seems stupid for me.


but it solves the problem. with the script i can really make the  
changes i need on the devel server.


so, is there a solution where i can use the ZMI?

how do you solve this kind of problem?


The problem is that you develop using the ZMI. It's a bad pattern.  
Don't do it.


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 )


Re: [Zope] developing with zmi: how to move a patch from data from devel to live?

2005-06-20 Thread gabor

Jens Vagelpohl wrote:


On 20 Jun 2005, at 07:35, gabor wrote:


now you create the fix/improvement on the devel server.

but now how do you move the improvement/fix to the live server?
you cannot just copy the data.fs over. the customer already has  some 
content/data in it...



one way seems to be to not use the ZMI at all. you create an  install 
python script, which calls the methods of the ZMI  interface. this way 
works, but it seems for me to waste my time.  finding the right method 
that the gui calls to call it from the  install script seems stupid 
for me.


but it solves the problem. with the script i can really make the  
changes i need on the devel server.


so, is there a solution where i can use the ZMI?

how do you solve this kind of problem?



The problem is that you develop using the ZMI. It's a bad pattern.  
Don't do it.




well, it's the opposite.

i (our company) don't develop using the ZMI.

i'm using an install script.

so when we install our program, no gui editing is needed.

but last week i've seen a presentation which used a CMS system called 
Typo3.


and a guy showed us how he can build a CMS only with gui tools. it was 
very fast and effective. and then i thought.. wow, you can work sooo 
fast in typo3. and we're so slow to develop with zope 
(plone/cmf/whatever). and then i remembered. but wait, we don't use the 
gui tools (zmi) at all! maybe we should!


an example:
for the next version of the program, we decided to change an action what 
happens when you click on a TAB in the CMS. in gui, i would do it like this:
go to the portal_actions object, find the correct tab, change the 
python-script associated to it.


but we had to dig thru the source code, to find out how the ZMI does it, 
and follow the same process when we did it programmatically in the 
python install script. it took us let's say 4-5hours (partly because 
that part of the CMF was badly documented, and used a quite inconvenient 
way to handle that)


compare that:
1minutes in the ZMI or 5hours in a python-script. which one is better?

well, or let me ask the question a different way:
if i should not use the ZMI, then why is it there?

gabor
___
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] developing with zmi: how to move a patch from data from devel to live?

2005-06-20 Thread Jens Vagelpohl


On 20 Jun 2005, at 10:16, gabor wrote:

well, or let me ask the question a different way:
if i should not use the ZMI, then why is it there?


The ZMI is great for maintenance tasks, but not great for software  
development. You already ran into the first issue, replicating  
changes to other machines. Then there is no way to apply sane  
software development techniques, like using version control software  
and developing in a team.


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 )


Re: [Zope] Passing parameters using DTML

2005-06-20 Thread John Poltorak
On Fri, Jun 17, 2005 at 05:39:23PM -0500, J Cameron Cooper wrote:

 I'm assuming the above line comes from a page template.
 You neglected to mention what the calling DTML looks like,
 but I *guess* that it was something like this:
 dtml-var some_template(parm='ABC')
 yes? no?
  
  
  This is what I have:-
  
  dtml-var expr=testlist(parm='myobjectname')
  
  I wish to get 'myobjectname' into this line in 'testlist' which is marked
  with *
  
  python:here.parse_file(file=context.**,sepr=',',clone=1) 
  
  There must be a simple way of doing this, but I haven't come across an 
  example of it and I've spent most of the day on it.
 
 Taking the options from my previous email and putting them together, you 
 can say::
 
 python:here.parse_file(file=getattr(context,options.parm),...)
 
 to get the attribute on the current context named 'myobjectname' or 
 whatever else you provide as the 'parm' parameter on 'testlist'.

Many thanks. I appreciate the help. I think I've incorporated your 
suggestion into the code below...

html
   body
 span
tal:define=opts 
python:here.parse_file(file=getattr(context,options.parm),sepr=',',clone=1) 
   tal:block repeat=opt opts
  lia tal:content=python:opt[1]
   tal:attributes=href python:opt[0]/a/li
   /tal:block
 /span
   /body
/html


Unfortunately, when I try to use this expression

dtml-var expr=testlist(parm='links')

I get this Zope error:-

Error Type: AttributeError
Error Value: 'dict' object has no attribute 'parm'

Can't help thinking it is a simple syntax error - missing bracker, quote 
etc... but just can't figure it out.


   --jcc
 
 -- 
 Building Websites with Plone
 http://plonebook.packtpub.com/
 
 Enfold Systems, LLC
 http://www.enfoldsystems.com


-- 
John


___
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] Graphical front end for Zope?

2005-06-20 Thread Lennart Regebro
On 6/20/05, John Poltorak [EMAIL PROTECTED] wrote:
 I don't suppose there is such a thing as a graphical front end for
 building Zope sites...
 
 I've just been trying out a Flash based product called SiteMaker
 
 http://www.moonfruit.com/
 
 which made designing web pages a doddle. Just wish there was something
 which would simplify the building of a Zope site.

Well, later version of CPS contains CPSSkins, which allows you to
design your site graphically, and CPSTypeMaker, which allows you to
create new types easily.

Maybe that's something similar?
-- 
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.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 )


[Zope] where is the appendix in the online book

2005-06-20 Thread Michael Rosenberg

i was searching for the same thing today,
and i found it at: http://plone-book.agmweb.ca/
you have to chexk out each chapters errata, from there you have links to 
each chapters relavant scripts and links.

a little tricky, huh ?
hope to have been of some help,
michi
___
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] ZODB error when trying to index object (Input/output error)

2005-06-20 Thread Felix Ulrich-Oltean
Hi

I get the following error when certain new objects are added into a
plone site - when archetypes tries to set the UID, it asks the catalog
for all unique values of the index UID.  I;ve never had input/output
errors before from the ZODB.  There's definitely enough space on the
drive and objects are added fine - it's just that the UID is then not
set, which breaks all sorts of Archetypes stuff.  Any ideas how I can
hunt this one down?

Thanks,

Felix.


2005-06-20T13:15:26 ERROR(200) ZODB Couldn't load state for 0x111310
Traceback (most recent call last):
  File /usr/local/zope/lib/python/ZODB/Connection.py, line 597, in setstate
p, serial = self._storage.load(oid, self._version)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 689, in load
return self._load(oid, version, self._index, self._file)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 662, in _load
h = read(DATA_HDR_LEN)
IOError: [Errno 5] Input/output error
--
2005-06-20T13:15:26 ERROR(200) Archetypes None
Traceback (most recent call last):
  File /zope/global-products/Archetypes/Referenceable.py, line 69, in 
_register
cid = archetype_tool.registerContent(self)
  File /zope/global-products/Archetypes/ArchetypeTool.py, line 681, in 
registerContent
cid = self._genId(object)
  File /zope/global-products/Archetypes/ArchetypeTool.py, line 659, in _genId
keys = catalog.uniqueValuesFor('UID')
  File /usr/local/zope/lib/python/Products/ZCatalog/ZCatalog.py, line 562, in 
uniqueValuesFor
return self._catalog.uniqueValuesFor(name)
  File /usr/local/zope/lib/python/Products/ZCatalog/Catalog.py, line 425, in 
uniqueValuesFor
return self.getIndex(name).uniqueValues()
  File /usr/local/zope/lib/python/Products/PluginIndexes/common/UnIndex.py, 
line 445, in uniqueValues
return tuple(self._index.keys())
  File /usr/local/zope/lib/python/ZODB/Connection.py, line 597, in setstate
p, serial = self._storage.load(oid, self._version)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 689, in load
return self._load(oid, version, self._index, self._file)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 662, in _load
h = read(DATA_HDR_LEN)
IOError: [Errno 5] Input/output error

___
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] developing with zmi: how to move a patch from data fro m devel to live?

2005-06-20 Thread Paul Winkler
On Mon, Jun 20, 2005 at 09:13:57AM +0200, Pascal Peregrina wrote:
 You can manually export objects from your dev zope to individual files and
 then import them back to the live instance through ZMI.
 
 You could try this : http://zsyncer.sourceforge.net/
 It will enable you, for built-in Zope object types (but then you can extend
 it with your own types) to list the differences between your dev and live
 zope instances and deploy your changes.

... in a limited fashion, yes.
However, it doesn't tell you anything about valuable metadata such
as properties, security settings, etc.
And if you sync a folderish object, zsyncer will necessarily sync
all its sub-objects as well.  But within those limitations,
it's still pretty useful.
 
-- 

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] custom_persist_obj

2005-06-20 Thread Tamas Hegedus

Hi,

I am new to Zope and not a programmer. It is a little bit complex for
me. I am very frustrated, as I can not find the solution for a pretty
simple task:

I would like to have persistent object with dictionaries.
I think I do not need a ZClass or Product, just a simple object for
holding mutable and persistent dictionaries (Manipulating with Script).
Like
MyObject:
  dict1 = [ a:1, b:1, c:1, ...]
  dict2 = [ a:2, d:4, e:6]
  etc.

Thanks for your help in advance,
Tamas
___
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] custom_persist_obj

2005-06-20 Thread Paul Winkler
On Mon, Jun 20, 2005 at 05:12:29AM -0400, Tamas Hegedus wrote:
 Hi,
 
 I am new to Zope and not a programmer. It is a little bit complex for
 me. I am very frustrated, as I can not find the solution for a pretty
 simple task:
 
 I would like to have persistent object with dictionaries.
 I think I do not need a ZClass or Product, just a simple object for
 holding mutable and persistent dictionaries (Manipulating with Script).
 Like
 MyObject:
   dict1 = [ a:1, b:1, c:1, ...]
   dict2 = [ a:2, d:4, e:6]
   etc.
 
 Thanks for your help in advance,
 Tamas

If you want a custom persistent object, you do indeed
need to write a Product.

But that needn't be complex.
http://www.zope.org/Members/maxm/HowTo/minimal_01


-- 

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 )


RE: [Zope] custom_persist_obj

2005-06-20 Thread Pascal Peregrina
You have a built-in Zope object for this : PersistentMapping.

dict1=PersistentMapping({'a':1,'b':1,'c':1, ...})
dict1=PersistentMapping({'a':2,'d':4,'e':6})

The only thing you can not do compared to dictionaries is :
for key in dict1:
 do something
(you need to use for key in dict1.keys():...)

Pascal

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de
Tamas Hegedus
Envoyé : lundi 20 juin 2005 11:12
À : zope@zope.org
Objet : [Zope] custom_persist_obj


Hi,

I am new to Zope and not a programmer. It is a little bit complex for
me. I am very frustrated, as I can not find the solution for a pretty
simple task:

I would like to have persistent object with dictionaries.
I think I do not need a ZClass or Product, just a simple object for
holding mutable and persistent dictionaries (Manipulating with Script).
Like
MyObject:
   dict1 = [ a:1, b:1, c:1, ...]
   dict2 = [ a:2, d:4, e:6]
   etc.

Thanks for your help in advance,
Tamas
___
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 )


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.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 )


Re: [Zope] custom_persist_obj

2005-06-20 Thread Paul Winkler
Well, sure. But you need to write some unrestricted (i.e.
filesystem-based) code if you want to create instanced of
PersistentMapping and the like.

by the way, if it's ever going to get large, you might look
into using OOBTree instead of PersistentMapping.
See:
http://www.zope.org/Wikis/ZODB/guide/node6.html#SECTION00063

-PW

On Mon, Jun 20, 2005 at 03:24:12PM +0200, Pascal Peregrina wrote:
 You have a built-in Zope object for this : PersistentMapping.
 
 dict1=PersistentMapping({'a':1,'b':1,'c':1, ...})
 dict1=PersistentMapping({'a':2,'d':4,'e':6})
 
 The only thing you can not do compared to dictionaries is :
 for key in dict1:
  do something
 (you need to use for key in dict1.keys():...)
 
 Pascal
 
 -Message d'origine-
 De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de
 Tamas Hegedus
 Envoy? : lundi 20 juin 2005 11:12
 ? : zope@zope.org
 Objet : [Zope] custom_persist_obj
 
 
 Hi,
 
 I am new to Zope and not a programmer. It is a little bit complex for
 me. I am very frustrated, as I can not find the solution for a pretty
 simple task:
 
 I would like to have persistent object with dictionaries.
 I think I do not need a ZClass or Product, just a simple object for
 holding mutable and persistent dictionaries (Manipulating with Script).
 Like
 MyObject:
dict1 = [ a:1, b:1, c:1, ...]
dict2 = [ a:2, d:4, e:6]
etc.
 
 Thanks for your help in advance,
 Tamas
 ___
 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 )
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 
 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 
 www.mimesweeper.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 )

-- 

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 )


Re: [Zope] Getting information about current method

2005-06-20 Thread Florent Guillaume
Peter Bengtsson  [EMAIL PROTECTED] wrote:
 On 6/17/05, Jan-Ole Esleben [EMAIL PROTECTED] wrote:
  It's an application instance wrapped in a list; it seems to be
  identical to self, actually - self.REQUEST['URL'] and
  self.REQUEST.PARENTS[0].REQUEST['URL'] are the same. However, the two
  REQUESTs are not the identical object (== returns False).
  
 
 Then I don't know. 
 (The application instance is none other than zope itself. )
 I can honestly not think of a way to extract this information. I've
 even tried setting up a simple example method and I couldn't get hold
 of the zodb name of the external method that is called.

You can go the low-level route: Using the inspect module, you can get to
the stack frames of your callers, and then inspect the local variables
there. There must be one that can get you the information you want.

See the docstrings of the functions in the inspect module for details.

Florent

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

2005-06-20 Thread Florent Guillaume
Dieter Maurer  [EMAIL PROTECTED] wrote:
 Jürgen Herrmann wrote at 2005-6-17 14:19 +0200:
 i make heavy use of indexes in my extension classes. these all inherit
 from catalogpathaware, so i have to call object.reindex_object() on
 each changed instance. calling it from attribute getters/setters f.ex.
 is not a good idea, because changing 3 attributes will reindex the object
 3 times.
 
 what i'd like to have is that such objects are reindexed automatically
 before comitting a transaction.
 
 is it possible? where should i start looking in the source, is there
 possibly a before_transaction_commit hook?
 
 It is impossible with ZODB 3.2 (unless you patch
 ZODB.Transaction.Transaction).

The CPSCompat module of CPS has monkey-patches that backport this from
ZODB 3.4, among others, to be used in Zope 2.7.

http://svn.nuxeo.org/trac/pub/file/CPSCompat/trunk/PatchZODBTransaction.py

Florent

 ZODB 3.4 (which is used for Zope 2.8/3.1) has hooks
 that makes it possible.


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

2005-06-20 Thread Peter Bengtsson
 
  Then I don't know.
  (The application instance is none other than zope itself. )
  I can honestly not think of a way to extract this information. I've
  even tried setting up a simple example method and I couldn't get hold
  of the zodb name of the external method that is called.
 
 You can go the low-level route: Using the inspect module, you can get to
 the stack frames of your callers, and then inspect the local variables
 there. There must be one that can get you the information you want.
 

We tried that but no luck. 

 See the docstrings of the functions in the inspect module for details.
 
 Florent
 
 --
 Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
 +33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.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 )


Re: [Zope] ZODB error when trying to index object (Input/output error)

2005-06-20 Thread J Cameron Cooper

Felix Ulrich-Oltean wrote:


I get the following error when certain new objects are added into a
plone site - when archetypes tries to set the UID, it asks the catalog
for all unique values of the index UID.  I;ve never had input/output
errors before from the ZODB.  There's definitely enough space on the
drive and objects are added fine - it's just that the UID is then not
set, which breaks all sorts of Archetypes stuff.  Any ideas how I can
hunt this one down?


This IOError typically indicates a rights problem at the filesystem 
level. I could also be a full-disk problem or maybe a file corruption.


Check the OS-level stuff first, and then try the usual ZODB 
check/recover stuff.


I don't think this is relevant, but it may be useful:

http://mail.python.org/pipermail/python-list/2003-March/151633.html

--jcc


2005-06-20T13:15:26 ERROR(200) ZODB Couldn't load state for 0x111310
Traceback (most recent call last):
  File /usr/local/zope/lib/python/ZODB/Connection.py, line 597, in setstate
p, serial = self._storage.load(oid, self._version)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 689, in load
return self._load(oid, version, self._index, self._file)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 662, in _load
h = read(DATA_HDR_LEN)
IOError: [Errno 5] Input/output error
--
2005-06-20T13:15:26 ERROR(200) Archetypes None
Traceback (most recent call last):
  File /zope/global-products/Archetypes/Referenceable.py, line 69, in 
_register
cid = archetype_tool.registerContent(self)
  File /zope/global-products/Archetypes/ArchetypeTool.py, line 681, in 
registerContent
cid = self._genId(object)
  File /zope/global-products/Archetypes/ArchetypeTool.py, line 659, in _genId
keys = catalog.uniqueValuesFor('UID')
  File /usr/local/zope/lib/python/Products/ZCatalog/ZCatalog.py, line 562, in 
uniqueValuesFor
return self._catalog.uniqueValuesFor(name)
  File /usr/local/zope/lib/python/Products/ZCatalog/Catalog.py, line 425, in 
uniqueValuesFor
return self.getIndex(name).uniqueValues()
  File /usr/local/zope/lib/python/Products/PluginIndexes/common/UnIndex.py, 
line 445, in uniqueValues
return tuple(self._index.keys())
  File /usr/local/zope/lib/python/ZODB/Connection.py, line 597, in setstate
p, serial = self._storage.load(oid, self._version)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 689, in load
return self._load(oid, version, self._index, self._file)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 662, in _load
h = read(DATA_HDR_LEN)
IOError: [Errno 5] Input/output error


--
Building Websites with Plone
http://plonebook.packtpub.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] Re: ZODB error when trying to index object (Input/output error)

2005-06-20 Thread Felix Ulrich-Oltean
Felix Ulrich-Oltean [EMAIL PROTECTED] writes:

 Hi

 I get the following error when certain new objects are added into a
 plone site - when archetypes tries to set the UID, it asks the catalog
 for all unique values of the index UID.  I;ve never had input/output
 errors before from the ZODB.  There's definitely enough space on the
 drive and objects are added fine - it's just that the UID is then not
 set, which breaks all sorts of Archetypes stuff.  Any ideas how I can
 hunt this one down?



Some further info:

I think I've found the culprits - there are 4 records which give errors like 
this:

portal.portal_catalog.uncatalog_object('/sites/cw/data/urbanr')
Traceback (most recent call last):
  File stdin, line 1, in ?
  File /usr/local/zope/lib/python/Products/ZCatalog/ZCatalog.py, line 558, in 
uncatalog_object
self._catalog.uncatalogObject(uid)
  File /usr/local/zope/lib/python/Products/ZCatalog/Catalog.py, line 411, in 
uncatalogObject
x.unindex_object(rid)
  File 
/usr/local/zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py, 
line 138, in unindex_object
self._index[comp][level].remove(docid)
  File /usr/local/zope/lib/python/ZODB/Connection.py, line 597, in setstate
p, serial = self._storage.load(oid, self._version)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 689, in load
return self._load(oid, version, self._index, self._file)
  File /usr/local/zope/lib/python/ZODB/FileStorage.py, line 665, in _load
raise CorruptedDataError, h
ZODB.FileStorage.CorruptedDataError:

I'll try fsrecover on it.

Felix.


___
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] developing with zmi: how to move a patch from data from devel to live?

2005-06-20 Thread Dieter Maurer
gabor wrote at 2005-6-20 08:35 +0200:
 ...
but now how do you move the improvement/fix to the live server?
you cannot just copy the data.fs over. the customer already has some 
content/data in it...

This is possible as long you have a strict separation
between content (created on the life server) and
infrastructure (created in the develoment system).

Configuration may be partly controlled in the life and partly
in the development system. In this case, you need again
a strict separation between these worlds.

If this separation respects object boundaries (i.e. no updatable
object contains both life and development controlled
parts), then you can use Zope's export/import mechanism for
the synchronization. The use of export/import can be automated
as demonstrated by ZSyncer (others already suggested this solution).
ZSyncer integrates a local export and the corresponding remote
import in a single Web transaction. However, knowing your
application, you can integrate such exports and imports
for all your development controlled objects.

If the separation crosses object boundaries, you cannot use
export/import (as it would vipe out the life controlled parts of
the object). We extended the basic ZSyncer mechanism
to also synchronize partial objects. It essentially
works by defining _zsyncer__getstate__ and _zsyncer__setstate__
methods that extract and import partial content.

@Paul: let me know if you are interested in this ZSyncer extension.

-- 
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] accessing session data error

2005-06-20 Thread Leticia Larrosa


Hi all:


I 
think that I found a ZOPE bug. Is really very important for me know what can 
I do for avoid it. The first 9 steps are to recreate the situation and the 
other steps are to provoke the error.



Step 1: Crate a folder called "reproducingError" in Zope Interface 
Manage



Step 2: create a page template called "index_html" in the "reproducingError" 
folder with the following content:"!-- index_html page template 
--form name="form1" method="post" 
action="" input type="text" 
name="user" input type="submit" name="Submit" 
value="Submit"/form"



Step 3: create a python script called "init" in the "reproducingError" 
folder with the following content:"# init scriptsessionData = 
container.REQUEST.SESSIONsessionData.set("userId", 
container.REQUEST.user)

return context.init2_html()"



Step 4: create a page template called "init2_html" in the "reproducingError" 
folder with the following content:"!-- init2_html page template 
--a href=""passing face 2/a"



Step 5: create a python script called "init2" in the "reproducingError" 
folder with the following content:"# init2 scriptrequest = 
context.REQUESTsessionData = request.SESSION

sessionData.set('idService', 'testService')

context.first()return context.external(context)"



Step 6: create a page template called "first_html" in the "reproducingError" 
folder with the following content:"First Response"



Step 7: create a python script called "first" in the "reproducingError" 
folder with the following content:"# first scriptresponse = 
container.REQUEST.RESPONSEstr = container.first_html()
response.write(str)response.flush()"



Step 8: create an external method called "external" in the 
"reproducingError" folder with the following content, in where the function 
of the external method is "communicationResponse" and the module is any name 
that you give to the file:"# external methodimport time

def communicationResponse(context):

 response = context.REQUEST.RESPONSE 
sessionData = context.REQUEST.SESSION strDetailEnd = 
"scriptwindow.location='reproducingError/end'/script"
  for item in range(1, 40):
 time.sleep(3)
 response.write("Response 
iteration:" + str(item)) 
response.flush()

 response.write(strDetailEnd) 
response.flush()"



Step 9: create a python script called "end" in the "reproducingError" folder 
with the following content:"# end scriptidService = 
context.REQUEST.SESSION['idService']

return "Fin - " + idService"



Step 10: open two explorer in wich call the object "reproducingError" 
(Example: localhost:8080/reproducingError)



Step 11: enter an example text in each one.



Step 12: clink in the link of one of them, and 5 second later clink on the 
link of the other explorer. The waiting for around 5 second is necesary 
because with other time interval not allways get the error.



Stpe 13: and wait the "Response iteration"... Please if the error 
don't appear in any of the pages, begins at Step 9 again. and try to count 
to 5 witch other velocity :)



The correct result is:"Fin - testService"



The error is:"

Site ErrorAn error was encountered while publishing this resource. 


Error Type: KeyErrorError Value: 'idService'"The traceback:
"Traceback (innermost last): Module ZPublisher.Publish, line 
101, in publish Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 39, in call_object Module 
Shared.DC.Scripts.Bindings, line 306, in __call__ Module 
Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module 
Products.PythonScripts.PythonScript, line 323, in _exec Module 
None, line 2, in end - PythonScript at 
/approach/reproducingError/end - Line 2 Module 
AccessControl.ZopeGuards, line 67, in guarded_getitem Module 
Products.Transience.TransientObject, line 176, in __getitem__KeyError: 
'idService'"


I 
will appreciate if you try until the error appear, because I not always 
obtain the error. I thinks that it is bacause the time interval between the 
two request.


A 
curious thing is that when I obtain the error, if I wait around 15 second 
and refresh the page in wich i obtain the error, the correct result appear.. 
and no errors come.



Sorry for the extended message, but I need any help that you can give me, 
because this describe error environment imitate a funcionality that I must 
give in a system very import that i'm doing.



I'm using Zope 2.7.6 for Windows.



Thanks in advanced.

Leticia

___
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] ZMYSQLDA 2.0.9 lock problem

2005-06-20 Thread Dennis Allison
IE, Zope 2.7.6, Python 2.4.1, MYSQLDA 2.0.9

One of our developers is reporting a curious problem, which I have not
been able to track down.  It appears to be threading related, somewhere 
in the ZBMYSQLDB adaptor.

The database connection string is bare of transaction indicators.  The 
database is local.  All tables are MyISAM which is non-transactioal.

Unfortunately the user does not remember the exact sequence of events
which generate the problem so I am unable to duplicate.  What we do know
is that the problem occurs at the beginning of a development session begun
with a cold boot of the client machine and a fresh browser and it occurs
once and only onece during the development session.  The developer
normally has two active Zope threads going--one working with the
application and one working with the ZMI.  He moves between them using the
Open/View tab and other buttons.  He reports that the first time he moves
focus from the ZMI to the application, he gets the following error:

---
Time  2005/06/20 07:12:03.478 GMT-7
User Name (User Id)  (X)
Request URL http://xxx..com/logged_in
Exception Type error
Exception Value release unlocked lock

Traceback (innermost last):

* Module ZPublisher.Publish, line 107, in publish
* Module Zope.App.startup, line 222, in commit
* Module ZODB.Transaction, line 260, in commit
* Module ZODB.Transaction, line 377, in _finish_many
* Module Shared.DC.ZRDB.TM, line 59, in tpc_finish
* Module Products.ZMySQLDA.db, line 376, in _finish

error: release unlocked lock


The lock being released is a transactional lock.  None of our locks should 
be transactional locks, given our setup.  I traced through the __init__()
method for DB and did not see how transactional locking could be 
specified so the lock relaease code could run--I must be missing 
something.  No thread in our system uses transactional locking as the 
tables do no support transactions.

The logged_in method references the MySQL database in several places; a 
couple of them are compound queries where multiple queries are joined 
by dtml-var mysql_delimiter values.  Many of our queries use this 
in combination with the use database name SQL query.   

The system is using ZODB filestorage (Data.fs) with ZEO and is pretty 
much out of the box.

Has anyone else encountrered a similar problem.  Any suggestions as to how 
to find this bug?  

___
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] Problem with keep-alive timeout

2005-06-20 Thread Ralph

I made a small and simple database applikation with some reports on a large 
database. But surprise, IE 6.0 (WinXP,SP2) is getting always a timeout after 
60seconds, because IE communicates with Zope through the HTTP1.0-protocoll. 
My reports needing always 40s-120s, so is there someone that could give me a 
solution for this annoying timeout problem?

___
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] Problem with keep-alive timeout

2005-06-20 Thread Peter Bengtsson
I had a similar problem and solved it by having a cron job that runs
in the background with wget.
In my case was able to divid it up to run a little bit of the big
report at a time. This way I'm now able to have a cron job happening
every hour.

On 6/20/05, Ralph [EMAIL PROTECTED] wrote:
 
 I made a small and simple database applikation with some reports on a large
 database. But surprise, IE 6.0 (WinXP,SP2) is getting always a timeout after
 60seconds, because IE communicates with Zope through the HTTP1.0-protocoll.
 My reports needing always 40s-120s, so is there someone that could give me a
 solution for this annoying timeout problem?
 
 ___
 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 )
 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.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 )


Re: [Zope] accessing session data error

2005-06-20 Thread Chris McDonough
Hi Leticia,

Thanks for the detailed bug report.

I have tried to replicate the bug as you indicate below but cannot.
I've gone through the process you describe ten times without errors (in
Zope 2.7.6).

If it's possible to simplify the steps to recreate the error, that would
be helpful in further debugging (for example, maybe just getting rid of
all the page templates and python scripts and just using a single
external method).

- C


On Mon, 2005-06-20 at 14:20 -0400, Leticia Larrosa wrote:
 Hi all:
  
 I think that I found a ZOPE bug. Is really very important for me know
 what can I do for avoid it. The first 9 steps are to recreate the
 situation and the other steps are to provoke the error.
  
 Step 1: Crate a folder called reproducingError in Zope Interface
 Manage
  
 Step 2: create a page template called index_html in the
 reproducingError folder with the following content:
 
 !-- index_html page template --
 form name=form1 method=post action=reproducingError/init
   input type=text name=user
   input type=submit name=Submit value=Submit
 /form
 
  
 Step 3: create a python script called init in the reproducingError
 folder with the following content:
 
 # init script
 sessionData = container.REQUEST.SESSION
 sessionData.set(userId, container.REQUEST.user)
 return context.init2_html()
 
  
 Step 4: create a page template called init2_html in the
 reproducingError folder with the following content:
 
 !-- init2_html page template --
 a href=init2passing face 2/a
 
  
 Step 5: create a python script called init2 in the
 reproducingError folder with the following content:
 
 # init2 script
 request = context.REQUEST
 sessionData = request.SESSION
 sessionData.set('idService', 'testService')
 context.first()
 return context.external(context)
 
  
 Step 6: create a page template called first_html in the
 reproducingError folder with the following content:
 
 First Response
 
  
 Step 7: create a python script called first in the
 reproducingError folder with the following content:
 
 # first script
 response = container.REQUEST.RESPONSE
 str = container.first_html()
 response.write(str)
 response.flush()
 
  
 Step 8: create an external method called external in the
 reproducingError folder with the following content, in where the
 function of the external method is communicationResponse and the
 module is any name that you give to the file:
 
 # external method
 import time
 def communicationResponse(context):
 response = context.REQUEST.RESPONSE
 sessionData = context.REQUEST.SESSION
 strDetailEnd =
 scriptwindow.location='reproducingError/end'/script
 
 for item in range(1, 40):
 time.sleep(3)
 response.write(Response iteration: + str(item))
 response.flush()
 response.write(strDetailEnd)
 response.flush()
 
  
 Step 9: create a python script called end in the reproducingError
 folder with the following content:
 
 # end script
 idService = context.REQUEST.SESSION['idService']
 return Fin -  + idService
 
  
 Step 10: open two explorer in wich call the object
 reproducingError (Example: localhost:8080/reproducingError)
  
 Step 11: enter an example text in each one.
  
 Step 12: clink in the link of one of them, and 5 second later clink on
 the link of the other explorer. The waiting for around 5 second is
 necesary because with other time interval not allways get the error.
  
 Stpe 13: and wait the Response iteration...  Please if the error
 don't appear in any of the pages, begins at Step 9 again. and try to
 count to 5 witch other velocity :)
  
 The correct result is:
 
 Fin - testService
 
  
 The error is:
 
 Site Error
 An error was encountered while publishing this resource. 
 Error Type: KeyError
 Error Value: 'idService'
 
 The traceback:
 
 Traceback (innermost last):
   Module ZPublisher.Publish, line 101, in publish
   Module ZPublisher.mapply, line 88, in mapply
   Module ZPublisher.Publish, line 39, in call_object
   Module Shared.DC.Scripts.Bindings, line 306, in __call__
   Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
   Module Products.PythonScripts.PythonScript, line 323, in _exec
   Module None, line 2, in end
- PythonScript at /approach/reproducingError/end
- Line 2
   Module AccessControl.ZopeGuards, line 67, in guarded_getitem
   Module Products.Transience.TransientObject, line 176, in __getitem__
 KeyError: 'idService'
 
  
 I will appreciate if you try until the error appear, because I not
 always obtain the error. I thinks that it is bacause the time interval
 between the two request.
  
 A curious thing is that when I obtain the error, if I wait around 15
 second and refresh the page in wich i obtain the error, the correct
 result appear.. and no errors come.
  
 Sorry for the extended message, but I need any help that you can give
 me, because this describe error environment imitate a funcionality
 that I must give in a system very import that i'm doing.
  
 I'm using Zope 2.7.6 for Windows.
  
 

Re: [Zope] accessing session data error

2005-06-20 Thread Leticia Larrosa

Hi:

Thanks for the rapid aswer of Chris McDonough. I will change the 
steps to replicate the error (sorry for the large steps before :( , I thinks 
that maybe was needful). Remember that the key of the error is the time 
interval between the request. If with 5 seconds don't appear the 
errortry to vary to other, like 7 seconds. The 5 first steps are to 
create the situation and thesixth step are to provoke the 
error

Step 1: Create a folder called "reproducingError" in Zope Interface
Manage

Step 2: Create a srcipt "end" with the content:
"
# end scriptidService = context.REQUEST.SESSION['idService']
return "Fin - " + idService"

Step 3: Create a script "index_html" with the content:
"
# init scriptsessionData = container.REQUEST.SESSION
sessionData.set("userId", "userExample")return context.init2()
"

Step 4: Create a script "init2" with the content:
"
# init2 scriptrequest = context.REQUESTsessionData = 
request.SESSIONsessionData.set('idService', 'testService')return 
context.external(context)
"

Step 5:create an external method called "external" in the 
"reproducingError" folder with the following content, in where the
function of the external method is "communicationResponse" and the module is 
any name that you give to the file:
"
# external methodimport time
def communicationResponse(context):
 response = context.REQUEST.RESPONSE
 sessionData = context.REQUEST.SESSION
 strDetailEnd = 
"scriptwindow.location='reproducingError/end'/script"
  for item in range(1, 40):
 time.sleep(3)
 response.write("Response 
iteration:" + str(item)) 
response.flush()
 response.write(strDetailEnd) 
response.flush()
"

Step 6: opentwo explorer
In one of them call the object "reproducingError" (Example: 
localhost:8080/reproducingError), then wait 5 second and put in the other 
the same direction.
And wait the iterations

Note: I count 5 second, not with chronometer. You can try 
with a near number.

Chris: I reproduce the error with the steps. I can't reduce it to an 
external method. Thanks again.

The error that I obtain is the same:
"
Traceback (innermost last): Module ZPublisher.Publish, line 
101, in publish Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 39, in call_object Module 
Shared.DC.Scripts.Bindings, line 306, in __call__ Module 
Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module 
Products.PythonScripts.PythonScript, line 323, in _exec Module 
None, line 2, in end - PythonScript at 
/approach/reproducingError/end - Line 2 Module 
AccessControl.ZopeGuards, line 67, in guarded_getitem Module 
Products.Transience.TransientObject, line 176, in __getitem__KeyError: 
'idService'
"
Remember:
  A curious thing is that when I obtain the error, if I wait 
around 15  second and refresh the page in wich i obtain the 
error, the correct  result appear.. and no errors come.

  I'm using Zope 2.7.6 for Windows.

I must solve this, because this is part of my thesis for university 
graduation. Any help will be appreciated.

Thanks in advance, 
Leticia Larrosa
-Original Message-From: Chris McDonough 
[EMAIL PROTECTED]To: Leticia Larrosa 
[EMAIL PROTECTED]Cc: zope@zope.orgDate: Mon, 20 Jun 
2005 15:12:21 -0400Subject: Re: [Zope] accessing session data error
 Hi Leticia,  Thanks for the detailed bug report.
  I have tried to replicate the bug as you indicate below but 
cannot. I've gone through the process you describe ten times without 
errors (in Zope 2.7.6).  If it's possible to 
simplify the steps to recreate the error, that would be 
helpful in further debugging (for example, maybe just getting rid of 
all the page templates and python scripts and just using a single 
external method).  - C   On Mon, 
2005-06-20 at 14:20 -0400, Leticia Larrosa wrote:  Hi all:
I think that I found a ZOPE bug. Is really 
very important for me know  what can I do for avoid it. The 
first 9 steps are to recreate the  situation and the other steps 
are to provoke the error.Step 1: Crate a 
folder called "reproducingError" in Zope Interface  Manage
Step 2: create a page template called 
"index_html" in the  "reproducingError" folder with the 
following content:  "  !-- index_html page 
template --  form name="form1" method="post" 
action=""   input type="text" 
name="user"   input type="submit" name="Submit" 
value="Submit"  /form  "  
  Step 3: create a python script called "init" in the
 "reproducingError"  folder with the following content:
  "  # init script  sessionData = 
container.REQUEST.SESSION  sessionData.set("userId", 
container.REQUEST.user)  return context.init2_html() 
 "Step 4: create a page template 
called "init2_html" in the  "reproducingError" folder with the 
following content:  "  !-- init2_html page 
template --  a href=""passing face 
2/a  "Step 5: create a 
python script called "init2" in the  "reproducingError" folder 
with the following content:  "  # init2 script
  request = context.REQUEST  sessionData = 
request.SESSION  

Re: [Zope] accessing session data error

2005-06-20 Thread Leticia Larrosa

Hi:

I follow the steps to replicate the errorin zope2.7 for 
Debian and i get the error to.

Thanks in advanced, Leticia

-Original 
Message-From: "Leticia Larrosa" 
[EMAIL PROTECTED]To: "Chris McDonough" 
[EMAIL PROTECTED]Cc: zope@zope.orgDate: Mon, 20 Jun 2005 
16:25:08 -0400Subject: Re: [Zope] accessing session data error
Hi:

Thanks for the rapid aswer of Chris McDonough. I will change the 
steps to replicate the error (sorry for the large steps before :( , I thinks 
that maybe was needful). Remember that the key of the error is the time 
interval between the request. If with 5 seconds don't appear the 
errortry to vary to other, like 7 seconds. The 5 first steps are to 
create the situation and thesixth step are to provoke the 
error

Step 1: Create a folder called "reproducingError" in Zope Interface
Manage

Step 2: Create a srcipt "end" with the content:
"
# end scriptidService = context.REQUEST.SESSION['idService']
return "Fin - " + idService"

Step 3: Create a script "index_html" with the content:
"
# init scriptsessionData = container.REQUEST.SESSION
sessionData.set("userId", "userExample")return context.init2()
"

Step 4: Create a script "init2" with the content:
"
# init2 scriptrequest = context.REQUESTsessionData = 
request.SESSIONsessionData.set('idService', 'testService')return 
context.external(context)
"

Step 5:create an external method called "external" in the 
"reproducingError" folder with the following content, in where the
function of the external method is "communicationResponse" and the module is 
any name that you give to the file:
"
# external methodimport time
def communicationResponse(context):
 response = context.REQUEST.RESPONSE
 sessionData = context.REQUEST.SESSION
 strDetailEnd = 
"scriptwindow.location='reproducingError/end'/script"
  for item in range(1, 40):
 time.sleep(3)
 response.write("Response 
iteration:" + str(item)) 
response.flush()
 response.write(strDetailEnd) 
response.flush()
"

Step 6: opentwo explorer
In one of them call the object "reproducingError" (Example: 
localhost:8080/reproducingError), then wait 5 second and put in the other 
the same direction.
And wait the iterations

Note: I count 5 second, not with chronometer. You can try 
with a near number.

Chris: I reproduce the error with the steps. I can't reduce it to an 
external method. Thanks again.

The error that I obtain is the same:
"
Traceback (innermost last): Module ZPublisher.Publish, line 
101, in publish Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 39, in call_object Module 
Shared.DC.Scripts.Bindings, line 306, in __call__ Module 
Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module 
Products.PythonScripts.PythonScript, line 323, in _exec Module 
None, line 2, in end - PythonScript at 
/approach/reproducingError/end - Line 2 Module 
AccessControl.ZopeGuards, line 67, in guarded_getitem Module 
Products.Transience.TransientObject, line 176, in __getitem__KeyError: 
'idService'
"
Remember:
  A curious thing is that when I obtain the error, if I wait 
around 15  second and refresh the page in wich i obtain the 
error, the correct  result appear.. and no errors come.

  I'm using Zope 2.7.6 for Windows.

I must solve this, because this is part of my thesis for university 
graduation. Any help will be appreciated.

Thanks in advance, 
Leticia Larrosa
-Original Message-From: Chris McDonough 
[EMAIL PROTECTED]To: Leticia Larrosa 
[EMAIL PROTECTED]Cc: zope@zope.orgDate: Mon, 20 Jun 
2005 15:12:21 -0400Subject: Re: [Zope] accessing session data error
 Hi Leticia,  Thanks for the detailed bug report.
  I have tried to replicate the bug as you indicate below but 
cannot. I've gone through the process you describe ten times without 
errors (in Zope 2.7.6).  If it's possible to 
simplify the steps to recreate the error, that would be 
helpful in further debugging (for example, maybe just getting rid of 
all the page templates and python scripts and just using a single 
external method).  - C   On Mon, 
2005-06-20 at 14:20 -0400, Leticia Larrosa wrote:  Hi all:
I think that I found a ZOPE bug. Is really 
very important for me know  what can I do for avoid it. The 
first 9 steps are to recreate the  situation and the other steps 
are to provoke the error.Step 1: Crate a 
folder called "reproducingError" in Zope Interface  Manage
Step 2: create a page template called 
"index_html" in the  "reproducingError" folder with the 
following content:  "  !-- index_html page 
template --  form name="form1" method="post" 
action=""   input type="text" 
name="user"   input type="submit" name="Submit" 
value="Submit"  /form  "  
  Step 3: create a python script called "init" in the
 "reproducingError"  folder with the following content:
  "  # init script  sessionData = 
container.REQUEST.SESSION  sessionData.set("userId", 
container.REQUEST.user)  return context.init2_html() 
 "Step 4: create a page template 
called "init2_html" in the 

[Zope] Zope Foundation ideas

2005-06-20 Thread Rob Page

In preparation for tomorrow's IRC session (reminder/details
below) we have prepared some initial ideas about the Zope
Foundation.  These are available online at:

o http://tinyurl.com/74pd3

Note -- the document is written with phrases like the Foundation
will, Contributors shall, etc.  This is NOT to be interpreted
as though these terms/conditions are predetermined.  It is
written to close in on specific language that avoids
misinterpretation.

Zope Foundation IRC Session
---

IRC Session Summary:

  - Who:  Zope Corp and Zope Community
  - What: IRC session to discuss the Zope Foundation
  - When: Tue, 21 Jun 2005 10a - 12p (US EDT)
  - Where: irc.freenode.net #zope

Please send specific questions to:

  mailto:[EMAIL PROTECTED]

Hope to see you there.

Regards,
Rob

--

Rob PageV: 540.361.1710
Zope CorporationF: 703.995.0412

___
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] accessing session data error

2005-06-20 Thread Michael Dunstan

Hi Leticia,

The mixture of ``response.write()`` including JavaScript to drive the  
browser to a new location along with writing objects in ZODB all  
within the same transaction can break some of the promises that you'd  
normally expect Zope and a browser to keep.


My guess is that browser is being told to visit ``end`` before the  
transaction started by ``init2`` has finished. Perhaps a conflict  
error is causing that transaction to take longer than you expect.  
Normally this would not trip you up as your browser does not see  
anything until after the transaction has finished. (In this normal  
mode you might see a conflict error rendered in the browser if the  
publication machinery had to give up.)


For your example try breaking up ``init2`` into two scripts. The  
first that writes the session data and then redirects the browser to  
the second. The second then does not touch session data and manages  
all the ``response.write()``s. And remove the unused ``sessionData =  
context.REQUEST.SESSION`` from ``external``.


Cheers
Michael

On 21/06/2005, at 6:20 AM, Leticia Larrosa wrote:


Hi all:

I think that I found a ZOPE bug. Is really very important for me  
know what can I do for avoid it. The first 9 steps are to recreate  
the situation and the other steps are to provoke the error.


Step 1: Crate a folder called reproducingError in Zope Interface  
Manage


Step 2: create a page template called index_html in the  
reproducingError folder with the following content:


!-- index_html page template --
form name=form1 method=post action=reproducingError/init
  input type=text name=user
  input type=submit name=Submit value=Submit
/form


Step 3: create a python script called init in the  
reproducingError folder with the following content:


# init script
sessionData = container.REQUEST.SESSION
sessionData.set(userId, container.REQUEST.user)
return context.init2_html()


Step 4: create a page template called init2_html in the  
reproducingError folder with the following content:


!-- init2_html page template --
a href=init2passing face 2/a


Step 5: create a python script called init2 in the  
reproducingError folder with the following content:


# init2 script
request = context.REQUEST
sessionData = request.SESSION
sessionData.set('idService', 'testService')
context.first()
return context.external(context)


Step 6: create a page template called first_html in the  
reproducingError folder with the following content:


First Response


Step 7: create a python script called first in the  
reproducingError folder with the following content:


# first script
response = container.REQUEST.RESPONSE
str = container.first_html()
response.write(str)
response.flush()


Step 8: create an external method called external in the  
reproducingError folder with the following content, in where the  
function of the external method is communicationResponse and the  
module is any name that you give to the file:


# external method
import time
def communicationResponse(context):
response = context.REQUEST.RESPONSE
sessionData = context.REQUEST.SESSION
strDetailEnd = scriptwindow.location='reproducingError/end'/ 
script


for item in range(1, 40):
time.sleep(3)
response.write(Response iteration: + str(item))
response.flush()
response.write(strDetailEnd)
response.flush()


Step 9: create a python script called end in the  
reproducingError folder with the following content:


# end script
idService = context.REQUEST.SESSION['idService']
return Fin -  + idService


Step 10: open two explorer in wich call the object  
reproducingError (Example: localhost:8080/reproducingError)


Step 11: enter an example text in each one.

Step 12: clink in the link of one of them, and 5 second later clink  
on the link of the other explorer. The waiting for around 5 second  
is necesary because with other time interval not allways get the  
error.


Stpe 13: and wait the Response iteration...  Please if the error  
don't appear in any of the pages, begins at Step 9 again. and try  
to count to 5 witch other velocity :)


The correct result is:

Fin - testService


The error is:

Site Error
An error was encountered while publishing this resource.
Error Type: KeyError
Error Value: 'idService'

The traceback:

Traceback (innermost last):
  Module ZPublisher.Publish, line 101, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 323, in _exec
  Module None, line 2, in end
   - PythonScript at /approach/reproducingError/end
   - Line 2
  Module AccessControl.ZopeGuards, line 67, in guarded_getitem
  Module Products.Transience.TransientObject, line 176, in __getitem__
KeyError: 'idService'


I will appreciate if you try until the error appear, because I not  

[Zope] ZPT tutorial

2005-06-20 Thread John Poltorak

Does a ZPT tutorial exist anywhere?


-- 
John


___
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] ZPT tutorial

2005-06-20 Thread Peter Bengtsson
Don't know of a good tutorial but I know there are many. I'm sure that
plone.org has some good ones.

In case you already know your DTML, this little howto has helped people a lot.
http://www.zope.org/Members/peterbe/DTML2ZPT

On 6/20/05, John Poltorak [EMAIL PROTECTED] wrote:
 
 Does a ZPT tutorial exist anywhere?
 
 
 --
 John
 
 
 ___
 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 )
 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.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] New External Editor release 0.9

2005-06-20 Thread Chris McDonough
Since Casey Duncan, the original author of Zope External Editor is
happily hacking away on other things at a new job, I figure I might as
well pick up maintenance of this product.

The new location for External Editor releases will be:

  http://plope.com/software/ExternalEditor/

A new release (0.9) is available at that location and the changes for
the release are visible at
http://plope.com/software/ExternalEditor/CHANGES-0.9.txt .  Most changes
in this release are aimed at improving zopeedit behavior under Windows.

Have fun!

- C


___
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] installation problem

2005-06-20 Thread Andreas Jung



--On 20. Juni 2005 16:43:53 -0500 tyson [EMAIL PROTECTED] wrote:


Hi-
I got zope 2.8 installed on fedora core 4.  Whenever I execute this
command to start zope  /usr/local/zope/instance/bin/runzope,  I get this
error:

Error: The object named by DBTab.ClassFactories.autoClassFactory could
not be imported

Traceback (most recent call last):
  File /usr/local/zope/lib/python/Zope2/Startup/datatypes.py, line 93,
in importable_name
package = __import__(n, g, g, component)
  File /usr/local/zope/lib/python/DBTab/ClassFactories.py, line 18, in ?
import OFS.Uninstalled
  File /usr/local/zope/lib/python/OFS/Uninstalled.py, line 16, in ?
import  SimpleItem, Globals, Acquisition
  File /usr/local/zope/lib/python/OFS/SimpleItem.py, line 25, in ?
import Globals, App.Management, Acquisition, App.Undo
  File /usr/local/zope/lib/python/Globals.py, line 23, in ?
import Acquisition, ComputedAttribute, App.PersistentExtra, os
  File /usr/local/zope/lib/python/App/PersistentExtra.py, line 16, in ?
from class_init import default__class_init__
  File /usr/local/zope/lib/python/App/class_init.py, line 14, in ?
from AccessControl.PermissionRole import PermissionRole
  File /usr/local/zope/lib/python/AccessControl/__init__.py, line 17,
in ?
from Implementation import setImplementation
  File /usr/local/zope/lib/python/AccessControl/Implementation.py, line
98, in ?
setImplementation(C)
  File /usr/local/zope/lib/python/AccessControl/Implementation.py, line
51, in setImplementation
from AccessControl import ImplC as impl
  File /usr/local/zope/lib/python/AccessControl/ImplC.py, line 29, in ?
from ImplPython import RestrictedDTML, SecurityManager
ImportError: No module named ImplPython

(line 914 in file:///usr/local/zope/instance/etc/zope.conf)
For help, use /usr/local/zope/lib/python/Zope2/Startup/run.py -h

I noticed that this affected other people from some discussions, but I
couldn't find any solution.  Does anybody have an idea where I can start?
My buddy got his working on fedora core 4 fine, so it shouldn't be a
problem. When I first compiled zope, I used this command.  ./configure
--prefix=/usr/loca/zope --with-python=/usr/bin/python2.4.  Any help
would be much appreciated!



Try to compile Zope with a *fresh* Python 2.3.X installation and not with 
the FC4 Python. 2.4 is btw. not supported as documented and and as posted a 
hundred times.


-aj


pgpchYyuwPzBX.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] ZPT tutorial

2005-06-20 Thread Andreas Jung



--On 20. Juni 2005 23:45:34 +0100 John Poltorak [EMAIL PROTECTED] wrote:



Does a ZPT tutorial exist anywhere?



Aren't the *three* ZPT chapters in the Zope Book good enough?

-aj


pgpRrnfGY61Jv.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] ZPT tutorial

2005-06-20 Thread David H




Everyone,

I think the ZPT tutorials are excellent. Both "Using Page Templates"
and "Advanced Page Templates" are worth reading more than once. 

David


Andreas Jung wrote:

  
--On 20. Juni 2005 23:45:34 +0100 John Poltorak [EMAIL PROTECTED]
wrote:
  
  
  
Does a ZPT tutorial exist anywhere?


  
  
Aren't the *three* ZPT chapters in the Zope Book good enough?
  
  
-aj
  

  




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