[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Acquisition/ Merged from old philikon-aq-and-__parent__ branch:

2007-07-24 Thread Philipp von Weitershausen
Log message for revision 78314:
  Merged from old philikon-aq-and-__parent__ branch:
  
  Log message for revision 71221:
Step 2: Make aq_acquire aware of __parent__ pointers, even if the object
isn't acquisition wrapped.
  
  Log message for revision 71223:
Add another test that tests acquisition wrappers with containers that have 
__parent__.
  
  Log message for revision 71225:
Cosmetics: adjust a piece of code that I added earlier to the indentation
style of the overall file
  
  Log message for revision 71226:
Cleanup:
* no need to introduce another variable where we check for a __parent__ 
attribute
* clean up after failed getattr (it throws an AttributeError)
* properly DECREF the __parent__ attribute when it's no longer needed and
  the wrapper that is temporarily created from the __parent__ attribute.
  
  Log message for revision 75578:
Added a test to Acquisition that shows the current segmentation fault 
problem, when Acquisition goes in circles.
  
  Log message for revision 76140:
First attempt to fix 'Acquisition problem' when encountering cyclic 
hierarchies via __parent__ pointers. [hannosch, nouri]
  
  
  In addition, Hanno and Nouri's fix was expanded to not only cover circular 
__parent__
  pointers but also to cover a mixture of circular __parent__ and aq_parent 
pointers
  (which can occur when old Implicit acquisition meets new __parent__ pointer 
code).
  
  Also cleaned up much of the comments and added more comments.
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Acquisition/_Acquisition.c
  U   Zope/branches/philikon-aq/lib/python/Acquisition/tests.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Acquisition/_Acquisition.c
===
--- Zope/branches/philikon-aq/lib/python/Acquisition/_Acquisition.c 
2007-07-24 14:41:47 UTC (rev 78313)
+++ Zope/branches/philikon-aq/lib/python/Acquisition/_Acquisition.c 
2007-07-24 19:40:28 UTC (rev 78314)
@@ -38,7 +38,8 @@
   *py__long__, *py__float__, *py__oct__, *py__hex__,
   *py__getitem__, *py__setitem__, *py__delitem__,
   *py__getslice__, *py__setslice__, *py__delslice__,  *py__contains__,
-  *py__len__, *py__of__, *py__call__, *py__repr__, *py__str__, *py__cmp__;
+  *py__len__, *py__of__, *py__call__, *py__repr__, *py__str__, *py__cmp__,
+  *py__parent__;
 
 static PyObject *Acquired=0;
 
@@ -82,7 +83,7 @@
   INIT_PY_NAME(__repr__);
   INIT_PY_NAME(__str__);
   INIT_PY_NAME(__cmp__);
-  
+  INIT_PY_NAME(__parent__);
 #undef INIT_PY_NAME
 }
 
@@ -414,6 +415,23 @@
 Wrapper_findattr(Wrapper *self, PyObject *oname,
PyObject *filter, PyObject *extra, PyObject *orig,
int sob, int sco, int explicit, int containment)
+/*
+  Parameters:
+
+  sob
+Search self-obj for the 'oname' attribute
+
+  sco
+Search self-container for the 'oname' attribute
+
+  explicit
+Explicitly acquire 'oname' attribute from container (assumed with
+implicit acquisition wrapper)
+
+  containment
+Use the innermost wrapper (aq_inner) for looking up the 'oname'
+attribute.
+*/
 {
   PyObject *r, *v, *tb;
   char *name=;
@@ -486,6 +504,7 @@
  Py_XDECREF(r); Py_XDECREF(v); Py_XDECREF(tb);
  r=NULL;
}
+ /* normal attribute lookup */
   else if ((r=PyObject_GetAttr(self-obj,oname)))
{
  if (r==Acquired)
@@ -520,6 +539,7 @@
   PyErr_Clear();
 }
 
+  /* Lookup has failed, acquire it from parent. */
   if (sco  (*name != '_' || explicit)) 
 return Wrapper_acquire(self, oname, filter, extra, orig, explicit, 
   containment);
@@ -533,24 +553,35 @@
PyObject *filter, PyObject *extra, PyObject *orig,
int explicit, int containment)
 {
-  PyObject *r;
+  PyObject *r,  *v, *tb;
   int sob=1, sco=1;
 
   if (self-container)
 {
+  /* If the container has an acquisition wrapper itself, we'll use
+ Wrapper_findattr to progress further. */
   if (isWrapper(self-container))
{
  if (self-obj  isWrapper(self-obj))
{
- /* Try to optimize search by recognizing repeated obs in path */
+ /* Try to optimize search by recognizing repeated
+ objects in path. */
  if (WRAPPER(self-obj)-container==
  WRAPPER(self-container)-container) 
sco=0;
  else if (WRAPPER(self-obj)-container==
  WRAPPER(self-container)-obj)  
sob=0;
-  }
+   }
 
+  /* Don't search the container when the container of the
+ container is the same object as 'self'. */
+  if (WRAPPER(self-container)-container == WRAPPER(self)-obj)
+{
+  sco=0;
+  containment=1;
+}
+
  r=Wrapper_findattr((Wrapper*)self-container,
 oname, filter, extra, 

[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Acquisition/ Merged from old philikon-aq-and-__parent__ branch:

2007-07-24 Thread Philipp von Weitershausen
Log message for revision 78318:
  Merged from old philikon-aq-and-__parent__ branch:
  
  Log message for revision 71227:
Step 4: Make aq_get aware of __parent__ pointers.
(Also some comment cosmetics in _Acquisition.c)
  
  Log message for revision 71228:
Test aq_parent property as well (in addition to aq_parent function)
  
  Log message for revision 71229:
Step 5: Make aq_chain aware of __parent__ pointers.
  
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Acquisition/_Acquisition.c
  U   Zope/branches/philikon-aq/lib/python/Acquisition/tests.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Acquisition/_Acquisition.c
===
--- Zope/branches/philikon-aq/lib/python/Acquisition/_Acquisition.c 
2007-07-24 20:46:33 UTC (rev 78317)
+++ Zope/branches/philikon-aq/lib/python/Acquisition/_Acquisition.c 
2007-07-24 21:02:03 UTC (rev 78318)
@@ -1422,8 +1422,7 @@
  WRAPPER(self)-ob_type==(PyTypeObject*)Wrappertype,
  explicit, containment);  
   /* Not wrapped; check if we have a __parent__ pointer.  If that's
- the case, we create a wrapper and pretend it's business as
- usual */
+ the case, create a wrapper and pretend it's business as usual. */
   else if ((result = PyObject_GetAttr(self, py__parent__)))
 {
   self = newWrapper(self, result, (PyTypeObject*)Wrappertype);
@@ -1437,8 +1436,8 @@
   /* No wrapper and no __parent__, so just getattr. */
   else
 {
-  /* We need to clean up the AttributeError from the previous
- getattr (because it has clearly failed). */
+  /* Clean up the AttributeError from the previous getattr
+ (because it has clearly failed). */
   PyErr_Fetch(result,v,tb);
   if (result  (result != PyExc_AttributeError))
 {
@@ -1486,13 +1485,35 @@
 static PyObject *
 capi_aq_get(PyObject *self, PyObject *name, PyObject *defalt, int containment)
 {
-  PyObject *result = NULL;
+  PyObject *result = NULL, *v, *tb;
   /* We got a wrapped object, so business as usual */
   if (isWrapper(self)) 
 result=Wrapper_findattr(WRAPPER(self), name, 0, 0, OBJECT(self), 1, 1, 1, 
-  containment);
+containment);
+  /* Not wrapped; check if we have a __parent__ pointer.  If that's
+ the case, create a wrapper and pretend it's business as usual. */
+  else if ((result = PyObject_GetAttr(self, py__parent__)))
+{
+  self=newWrapper(self, result, (PyTypeObject*)Wrappertype);
+  Py_DECREF(result); /* don't need __parent__ anymore */
+  result=Wrapper_findattr(WRAPPER(self), name, 0, 0, OBJECT(self),
+  1, 1, 1, containment);
+  Py_DECREF(self); /* Get rid of temporary wrapper. */
+}
   else
-result=PyObject_GetAttr(self, name);
+{
+  /* Clean up the AttributeError from the previous getattr
+ (because it has clearly failed). */
+  PyErr_Fetch(result,v,tb);
+  if (result  (result != PyExc_AttributeError))
+{
+  PyErr_Restore(result,v,tb);
+  return NULL;
+}
+  Py_XDECREF(result); Py_XDECREF(v); Py_XDECREF(tb);
+ 
+  result=PyObject_GetAttr(self, name);
+}
 
   if (! result  defalt)
 {
@@ -1658,7 +1679,7 @@
 static PyObject *
 capi_aq_chain(PyObject *self, int containment)
 {
-  PyObject *result;
+  PyObject *result, *v, *tb;
 
   UNLESS (result=PyList_New(0)) return NULL;
 
@@ -1681,9 +1702,28 @@
}
}
   else
-   if (PyList_Append(result, self)  0)
- goto err;
+{
+  if (PyList_Append(result, self)  0)
+goto err;
 
+  if ((self=PyObject_GetAttr(self, py__parent__)))
+{
+  Py_DECREF(self); /* We don't need our own reference. */
+  if (self!=Py_None)
+continue;
+}
+  else
+{
+  PyErr_Fetch(self,v,tb);
+  if (self  (self != PyExc_AttributeError))
+{
+  PyErr_Restore(self,v,tb);
+  return NULL;
+}
+  Py_XDECREF(self); Py_XDECREF(v); Py_XDECREF(tb);
+}
+}
+
   break;
 }
   

Modified: Zope/branches/philikon-aq/lib/python/Acquisition/tests.py
===
--- Zope/branches/philikon-aq/lib/python/Acquisition/tests.py   2007-07-24 
20:46:33 UTC (rev 78317)
+++ Zope/branches/philikon-aq/lib/python/Acquisition/tests.py   2007-07-24 
21:02:03 UTC (rev 78318)
@@ -1725,14 +1725,26 @@
Acquisition.aq_acquire(x, 'bar')
   3.145
 
-as does ``aq_parent``:
+as does ``aq_get``:
 
+   Acquisition.aq_get(x, 'hello')
+  'world'
+   Acquisition.aq_get(x, 'foo')
+  42
+   Acquisition.aq_get(x, 'bar')
+  3.145
+
+and ``aq_parent``:
+
Acquisition.aq_parent(x) is y
   True

[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py Merged from old philikon-aq-and-__parent__ branch:

2007-07-24 Thread Philipp von Weitershausen
Log message for revision 78319:
  Merged from old philikon-aq-and-__parent__ branch:
  
  Log message for revision 77024:
Read that mail again, we agreed on raising an AttributeError instead of 
returning None.
  
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py
===
--- Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py  
2007-07-24 21:02:03 UTC (rev 78318)
+++ Zope/branches/philikon-aq/lib/python/Shared/DC/Scripts/Bindings.py  
2007-07-24 21:15:17 UTC (rev 78319)
@@ -179,6 +179,13 @@
 # Make *extra* sure that the wrapper isn't used to access
 # __call__, etc.
 if name.startswith('__'):
+# Acquisition will nowadays try to do an getattr on all
+# objects which aren't Acquisition wrappers, asking for a
+# __parent__ pointer.  We don't want to raise Unauthorized
+# in this case but simply an AttributeError.
+if name in ('__parent__', '__name__'):
+raise AttributeError(name)
+
 self.__you_lose()
 
 return guarded_getattr(self._wrapped, name, default)

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


[Zope-dev] Zope Tests: 5 OK

2007-07-24 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Mon Jul 23 12:00:00 2007 UTC to Tue Jul 24 12:00:00 2007 UTC.
There were 5 messages: 5 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Mon Jul 23 20:52:21 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-July/008077.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Mon Jul 23 20:53:52 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-July/008078.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Mon Jul 23 20:55:24 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-July/008079.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Mon Jul 23 20:56:54 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-July/008080.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Mon Jul 23 20:58:28 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-July/008081.html

___
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] IndexError

2007-07-24 Thread Jonathan

snip
- Original Message - 
From: kamal hamzat [EMAIL PROTECTED]

To: zope@zope.org
Sent: Monday, July 23, 2007 10:54 PM
Subject: [Zope] IndexError


I am having IndexError in some of my folders when i tried to view the 
content of Zcatalog created in these folders, but to my surprise this is not 
happening in other folders with similar Zcatalog. I am also not experiencing 
the same problem with objects of the old Zcatalog that I have catalog before 
this error. In an attempt to correct this error, i had duplicated the old 
Zcatalog and renamed it. But once i catalog the objects and try to view it, 
it will show the IndexError again.


Traceback (innermost last):
 a.. Module ZPublisher.Publish, line 119, in publish
 b.. Module ZPublisher.mapply, line 88, in mapply
 c.. Module ZPublisher.Publish, line 42, in call_object
 d.. Module OFS.DTMLMethod, line 143, in __call__
 DTMLMethod at /news/politics/test
 URL: http://www.news-online.com/politics/test/manage_main
 Physical Path:/news/politics/test
 e.. Module DocumentTemplate.DT_String, line 476, in __call__
 f.. Module DocumentTemplate.DT_In, line 676, in renderwob
 g.. Module AccessControl.ImplPython, line 191, in guarded_getitem
 h.. Module AccessControl.ZopeGuards, line 67, in guarded_getitem
 i.. Module Products.ZCatalog.Lazy, line 162, in __getitem__
IndexError: 1
/snip

This error occurs when the ZCatalog is trying to build a result set during a 
catalog search and an item in the catalog index cannot be added to the 
result set.  You may have a 'broken' object which was included in the 
catalog/index when you built (reindexed) the catalog (which may explain why 
your working/renamed catalog also failed).


Try looking at the objects you are adding to the catalog and see if any of 
them are invalid.  If you have a lot of items in the catalog you may have to 
write a python script to add the objects to the catalog, one-at-a-time, and 
test after the catalog after each object has been added in order to 
determine which object is causing the problem.


hth

Jonathan 


___
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] Declare constructor as public

2007-07-24 Thread Garito

Hi all!

How can I declare a product's constructor public?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito
___
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] Declare constructor as public

2007-07-24 Thread Andrew Milton
+---[ Garito ]--
| Hi all!
| 
| How can I declare a product's constructor public?
| 
| Thanks!

You have to declare a permission first such as: Add Garito Product when you
create your product, and register the class.

Then in the ZMI you simply add the roles you want access to that permission.

-- 
Andrew Milton
[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] Declare constructor as public

2007-07-24 Thread Garito

Hi Andrew!
In a normal method inside the product's class I use this:
security = ClassSecurityInfo()
security.setPermissionDefault('Freemind', ('Manager', 'Developer'))
security.declareProtected('Freemind', 'freemind')

But outside the class I have no idea how to create security object

Can I put a code like this outside the class?

Thanks!

2007/7/24, Andrew Milton [EMAIL PROTECTED]:


+---[ Garito ]--
| Hi all!
|
| How can I declare a product's constructor public?
|
| Thanks!

You have to declare a permission first such as: Add Garito Product when
you
create your product, and register the class.

Then in the ZMI you simply add the roles you want access to that
permission.

--
Andrew Milton
[EMAIL PROTECTED]





--
Mis Cosas
http://blogs.sistes.net/Garito
___
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 FileStorage inspection tool: treenalyser

2007-07-24 Thread Pelletier Vincent
Hi.

I created a ZODB FileStorage inspection tool which originaly derived from 
netspace.py (as of zope 2.8.8). I was especially interested in actual object 
content, so this script offers the possibility to hex dump objects, and 
exports some more knobs (recursion depth, subtree selection, more verbosity 
levels) as parameters and adds some features (python-friendly path rendering, 
recursion depth error handled).
I removed the pack-before-use feature as I consider it out of place (packing 
considered a read-only operation doesn't mean it should be made available in 
every tool doing read-only operations...).

You can get it from the following SVN repository:

https://svn.erp5.org/public/erp5/trunk/utils/treenalyser.py

ViewVC available at:

http://svn.erp5.org/erp5/trunk/utils/treenalyser.py

-- 
Vincent Pelletier

PS: Yeah, its name is bad... Feel free to propose any better naming.
___
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: Declare constructor as public

2007-07-24 Thread J Cameron Cooper

Garito wrote:

Hi Andrew!
In a normal method inside the product's class I use this:
security = ClassSecurityInfo()
security.setPermissionDefault('Freemind', ('Manager', 'Developer'))
security.declareProtected ('Freemind', 'freemind')

But outside the class I have no idea how to create security object

Can I put a code like this outside the class?


No. Permission for a constructor is set when you register it, usually in 
the __init__.py. (context.registerClass)


   --jcc


2007/7/24, Andrew Milton 
[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]:


+---[ Garito ]--
| Hi all!
|
| How can I declare a product's constructor public?
|
| Thanks!

You have to declare a permission first such as: Add Garito Product
when you
create your product, and register the class.

Then in the ZMI you simply add the roles you want access to that
permission.


--
Connexions
http://cnx.org

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 )


Re: [Zope] Re: Declare constructor as public

2007-07-24 Thread Garito

Hi, J Cameron!
With constructor I mean the function I use to create the object. In this
case:
context.manage_addProduct['Yanged'].CrearYanged(NuevaId)

CrearYanged

How can I convert it to public?

Thanks!

2007/7/24, J Cameron Cooper [EMAIL PROTECTED]:


Garito wrote:
 Hi Andrew!
 In a normal method inside the product's class I use this:
 security = ClassSecurityInfo()
 security.setPermissionDefault('Freemind', ('Manager', 'Developer'))
 security.declareProtected ('Freemind', 'freemind')

 But outside the class I have no idea how to create security object

 Can I put a code like this outside the class?

No. Permission for a constructor is set when you register it, usually in
the __init__.py. (context.registerClass)

--jcc


 2007/7/24, Andrew Milton
 [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]:

 +---[ Garito ]--
 | Hi all!
 |
 | How can I declare a product's constructor public?
 |
 | Thanks!

 You have to declare a permission first such as: Add Garito Product
 when you
 create your product, and register the class.

 Then in the ZMI you simply add the roles you want access to that
 permission.

--
Connexions
http://cnx.org

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 )





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


Re: [Zope] Re: Declare constructor as public

2007-07-24 Thread Jonathan


- Original Message - 
From: Garito [EMAIL PROTECTED]

To: zope@zope.org
Sent: Tuesday, July 24, 2007 10:44 AM
Subject: Re: [Zope] Re: Declare constructor as public



Hi, J Cameron!
With constructor I mean the function I use to create the object. In this
case:
context.manage_addProduct['Yanged'].CrearYanged(NuevaId)

CrearYanged

How can I convert it to public?


Make sure that the folder and the script that contains the 
context.manage_addProduct['Yanged'].CrearYanged(NuevaId) code are 
accessible to the user.


Also, the folder where the new 'Yanged' instance is being created must be 
'writeable' by the user.


If it is not working, make sure that 'Unauthorized' is not listed in the 
'Ignored exception types' list in your error_log, so you can track the 
problem down.



Jonathan



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

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


Re: [Zope] Re: Declare constructor as public

2007-07-24 Thread Garito

Now the problem is with a manager user too (yesterday this user works ok)
I try to inspect the process to see where it fails but seems to be ok
The error is raised when Zope try to commit the changes

This is the traceback:

Traceback (innermost last):
 Module ZPublisher.Publish, line 121, in publish
 Module Zope2.App.startup, line 240, in commit
 Module transaction._manager, line 96, in commit
 Module transaction._transaction, line 380, in commit
 Module transaction._transaction, line 378, in commit
 Module transaction._transaction, line 433, in _commitResources
 Module ZODB.Connection, line 484, in commit
 Module ZODB.Connection, line 526, in _commit
 Module ZODB.Connection, line 553, in _store_objects
 Module ZODB.serialize, line 407, in serialize
 Module ZODB.serialize, line 416, in _dump
 Module copy_reg, line 69, in _reduce_ex
TypeError: can't pickle instancemethod objects



2007/7/24, Jonathan [EMAIL PROTECTED]:



- Original Message -
From: Garito [EMAIL PROTECTED]
To: zope@zope.org
Sent: Tuesday, July 24, 2007 10:44 AM
Subject: Re: [Zope] Re: Declare constructor as public


 Hi, J Cameron!
 With constructor I mean the function I use to create the object. In this
 case:
 context.manage_addProduct['Yanged'].CrearYanged(NuevaId)

 CrearYanged

 How can I convert it to public?

Make sure that the folder and the script that contains the
context.manage_addProduct['Yanged'].CrearYanged(NuevaId) code are
accessible to the user.

Also, the folder where the new 'Yanged' instance is being created must be
'writeable' by the user.

If it is not working, make sure that 'Unauthorized' is not listed in the
'Ignored exception types' list in your error_log, so you can track the
problem down.


Jonathan







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


Re: [Zope] Re: Declare constructor as public

2007-07-24 Thread Jonathan


- Original Message - 
From: Garito [EMAIL PROTECTED]

To: Jonathan [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Tuesday, July 24, 2007 11:47 AM
Subject: Re: [Zope] Re: Declare constructor as public



Now the problem is with a manager user too (yesterday this user works ok)
I try to inspect the process to see where it fails but seems to be ok
The error is raised when Zope try to commit the changes

This is the traceback:

Traceback (innermost last):
 Module ZPublisher.Publish, line 121, in publish
 Module Zope2.App.startup, line 240, in commit
 Module transaction._manager, line 96, in commit
 Module transaction._transaction, line 380, in commit
 Module transaction._transaction, line 378, in commit
 Module transaction._transaction, line 433, in _commitResources
 Module ZODB.Connection, line 484, in commit
 Module ZODB.Connection, line 526, in _commit
 Module ZODB.Connection, line 553, in _store_objects
 Module ZODB.serialize, line 407, in serialize
 Module ZODB.serialize, line 416, in _dump
 Module copy_reg, line 69, in _reduce_ex
TypeError: can't pickle instancemethod objects


Somehow you are trying to store a method that has been bound to an instance 
of a class.  You should investigate the object that you are trying to store 
and see what it really consists of.


Jonathan 


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

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


Re: [Zope] Re: Declare constructor as public

2007-07-24 Thread Garito

Hi again!
I detect some clues for the problem:

I use ExUserFolder as acl_user for the website who raises this error

The problem only raises if I'm authenticated as an user of the ExUserFolder
not if I'm authenticated as a root acl_user's user

In both cases the user has manager as roles but the main acl_users works ok
and the XUF one raises the error

Any idea?

2007/7/24, Garito [EMAIL PROTECTED]:


Now the problem is with a manager user too (yesterday this user works ok)
I try to inspect the process to see where it fails but seems to be ok
The error is raised when Zope try to commit the changes

This is the traceback:

Traceback (innermost last):
  Module ZPublisher.Publish, line 121, in publish
  Module Zope2.App.startup, line 240, in commit
  Module transaction._manager, line 96, in commit
  Module transaction._transaction, line 380, in commit

  Module transaction._transaction, line 378, in commit
  Module transaction._transaction, line 433, in _commitResources
  Module ZODB.Connection, line 484, in commit
  Module ZODB.Connection, line 526, in _commit

  Module ZODB.Connection, line 553, in _store_objects
  Module ZODB.serialize, line 407, in serialize
  Module ZODB.serialize, line 416, in _dump
  Module copy_reg, line 69, in _reduce_ex
TypeError: can't pickle instancemethod objects



2007/7/24, Jonathan [EMAIL PROTECTED]:


 - Original Message -
 From: Garito [EMAIL PROTECTED]
 To: zope@zope.org
 Sent: Tuesday, July 24, 2007 10:44 AM
 Subject: Re: [Zope] Re: Declare constructor as public


  Hi, J Cameron!
  With constructor I mean the function I use to create the object. In
 this
  case:
  context.manage_addProduct['Yanged'].CrearYanged(NuevaId)
 
  CrearYanged
 
  How can I convert it to public?

 Make sure that the folder and the script that contains the
 context.manage_addProduct['Yanged'].CrearYanged(NuevaId) code are
 accessible to the user.

 Also, the folder where the new 'Yanged' instance is being created must
 be
 'writeable' by the user.

 If it is not working, make sure that 'Unauthorized' is not listed in the

 'Ignored exception types' list in your error_log, so you can track the
 problem down.


 Jonathan






--
Mis Cosas
http://blogs.sistes.net/Garito





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


Re: [Zope] Re: Declare constructor as public

2007-07-24 Thread Garito

Hi, Jonathan!
Please, read my last message with the XUF consideration

Thanks!

2007/7/24, Jonathan [EMAIL PROTECTED]:



- Original Message -
From: Garito [EMAIL PROTECTED]
To: Jonathan [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Tuesday, July 24, 2007 11:47 AM
Subject: Re: [Zope] Re: Declare constructor as public


 Now the problem is with a manager user too (yesterday this user works
ok)
 I try to inspect the process to see where it fails but seems to be ok
 The error is raised when Zope try to commit the changes

 This is the traceback:

 Traceback (innermost last):
  Module ZPublisher.Publish, line 121, in publish
  Module Zope2.App.startup, line 240, in commit
  Module transaction._manager, line 96, in commit
  Module transaction._transaction, line 380, in commit
  Module transaction._transaction, line 378, in commit
  Module transaction._transaction, line 433, in _commitResources
  Module ZODB.Connection, line 484, in commit
  Module ZODB.Connection, line 526, in _commit
  Module ZODB.Connection, line 553, in _store_objects
  Module ZODB.serialize, line 407, in serialize
  Module ZODB.serialize, line 416, in _dump
  Module copy_reg, line 69, in _reduce_ex
 TypeError: can't pickle instancemethod objects

Somehow you are trying to store a method that has been bound to an
instance
of a class.  You should investigate the object that you are trying to
store
and see what it really consists of.

Jonathan





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


Re: [Zope] Re: Declare constructor as public

2007-07-24 Thread Andrew Milton
+---[ Garito ]--
| Hi again!
| I detect some clues for the problem:
| 
| I use ExUserFolder as acl_user for the website who raises this error
| 
| The problem only raises if I'm authenticated as an user of the ExUserFolder 
not
| if I'm authenticated as a root acl_user's user
| 
| In both cases the user has manager as roles but the main acl_users works ok 
and
| the XUF one raises the error
| 
| Any idea?

Are you trying to store something as a property of the user? That's the only
time XUF attempts to pickle anything.

-- 
Andrew Milton
[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] Re: Declare constructor as public

2007-07-24 Thread Garito

Sorry for the private message, Andrew
It seems like with the XUF user's roles don't work ok or something like this

2007/7/24, Andrew Milton [EMAIL PROTECTED]:


+---[ Garito ]--
| Hi again!
| I detect some clues for the problem:
|
| I use ExUserFolder as acl_user for the website who raises this error
|
| The problem only raises if I'm authenticated as an user of the
ExUserFolder not
| if I'm authenticated as a root acl_user's user
|
| In both cases the user has manager as roles but the main acl_users works
ok and
| the XUF one raises the error
|
| Any idea?

Are you trying to store something as a property of the user? That's the
only
time XUF attempts to pickle anything.

--
Andrew Milton
[EMAIL PROTECTED]





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


Re: [Zope] Re: Declare constructor as public

2007-07-24 Thread Garito

No
If I try this the call don't work with users in normal acl_user folder,
isn't it?

The call works ok with users stored in the root acl_user

2007/7/24, Andrew Milton [EMAIL PROTECTED]:


+---[ Garito ]--
| Hi again!
| I detect some clues for the problem:
|
| I use ExUserFolder as acl_user for the website who raises this error
|
| The problem only raises if I'm authenticated as an user of the
ExUserFolder not
| if I'm authenticated as a root acl_user's user
|
| In both cases the user has manager as roles but the main acl_users works
ok and
| the XUF one raises the error
|
| Any idea?

Are you trying to store something as a property of the user? That's the
only
time XUF attempts to pickle anything.

--
Andrew Milton
[EMAIL PROTECTED]





--
Mis Cosas
http://blogs.sistes.net/Garito
___
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] Pickle error and Zeo setup

2007-07-24 Thread Sudesh soni
BlankHi,

I am trying to update the 'SiteRootBase' in the secure.xml file and do import 
in zope , but I get error as shown in the screenshot.

I did same with secure.zexp and another error : cannot convert long int , i 
face when i import that file.

Why zope2.8.5 does not allow importing secure file after update.

I need to change /set the 'SiteRootBase' , is there any other way to achieve 
that?



Secondly I am setting up a ZEO server and I move the data.fs to ZEO storage 
location.

Q1. The data.fs I moved has SiteRootBase set to one of the zeo client URL.  I 
have another zeoclient which runs on a different URL/subdomain.
  As a result I see the same secure on another zeoclient ZMI, but as the 
SiteRootBase is set to the primary zeo client, Will this affect the request 
that will be diverted to the second zeo client ?

Q2. What settings I need to do to set up 2 zeo clients as I have one ZEO server 
running so that requests are properly served.  I am using mirroring feature 
from primary zeo client to divert request to another zeo client randomly.

Any help is appreciated in advance.

Regards
SuSon

Blank Bkgrd.gifattachment: zope error.GIF___
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 )