[Zope-dev] Copy without taking including the structure

2002-07-05 Thread Petter Enholm

Hi,

I am implementing a kind of Copy function which will strip off the sub level
of object being copied. The idea is to copy only the object marked for
copying - without the sub objects.
(For those interested: I use these objects as special kind of reference
objects  in my structure...)

In the new copy routine I have added these lines which avoids having the sub
level created:

[ ]

newObject = ob._getCopy(self)

for zob in newObject._objects:
   delattr(newObject, zob['id'])
newObject._objects = ()

[ . ]

self._setObject(newObject.id,newObject)   # add the object to the Zope
database

... delattr is the same method as used by _delOb, so I assumed this is the
safe way of doing it.
Can anyone tell me if this is not OK ? It seems to work very well 

Best regards

Petter Enholm
Snapper as
www.snapper.no






___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Splitter problem #3

2002-04-03 Thread Petter Enholm


Hi,

Like other people on the list I get problems with the splitter. I checked
out latest version of Zope from cvs today, compiled wo_pcgi.py and started
Zope. Running nicely. Then I shut down Zope and copied in a Data.fs file
from Zope 2.4.3 - which by the way runs nicely on Zope 2.5.1-b1.

When I now attempt to restart Zope I get several errors, among others this
one:

2002-04-03T18:01:41 ERROR(200) Zope Couldn't install PageTemplates
Traceback (innermost last):
  File /usr/local/Zope/lib/python/OFS/Application.py, line 639, in
install_product
(Object: Zope)
(Info: PageTemplates)
  File /usr/local/Zope/lib/python/Products/PageTemplates/__init__.py, line
28, in initialize
  File
/usr/local/Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py, line
342, in initialize
  File /usr/local/Zope/lib/python/App/ProductContext.py, line 318, in
registerHelp
  File /usr/local/Zope/lib/python/App/ProductContext.py, line 244, in
registerHelpTopic
  File /usr/local/Zope/lib/python/OFS/ObjectManager.py, line 290, in
_setObject
(Object: Help)
  File /usr/local/Zope/lib/python/HelpSys/HelpTopic.py, line 79, in
manage_afterAdd
(Object: PageTemplate_Edit.stx)
  File /usr/local/Zope/lib/python/HelpSys/HelpTopic.py, line 92, in
index_object
(Object: PageTemplate_Edit.stx)
  File /usr/local/Zope/lib/python/Products/ZCatalog/ZCatalog.py, line 476,
in catalog_object
(Object: catalog)
  File /usr/local/Zope/lib/python/Products/ZCatalog/Catalog.py, line 366, in
catalogObject
  File
/usr/local/Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py,
line 306, in index_object
(Object: SearchableText)
  File /usr/local/Zope/lib/python/ZODB/Connection.py, line 505, in setstate
SystemError: Failed to import class Splitter from module
Products.PluginIndexes.TextIndex.Splitter.ZopeSplitter

I checked the directory containing ZopeSplitter and I saw that the
__init__.py file was empy. I copied on the one from Zope-2.5.1-b1 - and Zope
starts without problems.  I am curious now, what is the problem here ? Can I
continue running with the __init__.py from older Zope version or is there
other things that must be done to my installation.

Best regards
Petter Enholm
Snapper




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Splitter problem #3

2002-04-03 Thread Petter Enholm


That is correct, but in the CVS tree the file is empty.
I checked out from the CVS tree yesterday.

Here:
http://cvs.zope.org/~checkout~/Zope/lib/python/Products/PluginIndexes/TextIn
dex/Splitter/ZopeSplitter/

I also downloaded a tar ball for the HEAD tag, which also gives a
__init__.py which zero bytes.

Best regards

Petter Enholm

- Original Message -
From: Andreas Jung [EMAIL PROTECTED]
To: Petter Enholm [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 6:37 PM
Subject: Re: [Zope-dev] Splitter problem #3



 - Original Message -
 From: Petter Enholm [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 03, 2002 11:27
 Subject: [Zope-dev] Splitter problem #3


 
  I checked the directory containing ZopeSplitter and I saw that the
  __init__.py file was empy. I copied on the one from Zope-2.5.1-b1 - and
 Zope
  starts without problems.  I am curious now, what is the problem here ?
Can
 I
  continue running with the __init__.py from older Zope version or is
there
  other things that must be done to my installation.

 Neither the  ZopeSplitter/__init__.py file for 2.4.3 nor 2.5.1b1 are empty
 for me.

 -aj



 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )