hi all, i'm doing a weekly import of a certain site. i'm using load_site.py but, since its a weekly update, the files i'm importing are already there. the load_site gives me a 'The id %s is invalid - it is already in use.' error ofcourse. can anyone help me to make loadsite overwrite the existing objects? thanks ps: i'm using this: Zope version: Zope 2.0.1 (source release, python 1.5.1, linux2) Python version: 1.5.2 (#1, Sep 21 1999, 19:05:55) [GCC 2.8.1] System Platform: sunos5 -- Maarten Slaets Web Developer KPNQwest Belgium http://www.fonky.com/vcard/MaartenSlaets/
On Fri, 4 Feb 2000, Maarten Slaets wrote:
i'm doing a weekly import of a certain site. i'm using load_site.py but, since its a weekly update, the files i'm importing are already there. the load_site gives me a 'The id %s is invalid - it is already in use.' error ofcourse. can anyone help me to make loadsite overwrite the existing objects?
Patch the load_site.py, wrap every call to manage_add with try/except, and on exception, do manage_edit instead. I'd recomment you to download later version of Zope and use recent load_site.py. You still nwill need to patch it. After testing your patches, please publish it here. Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
I didn't succceed to patch load_site.py that way. so I left the load_site as it is and modified the lib/python/OFS/ObjectManager.py instead, so: def _checkId(self, id, allow_dup=0): # If allow_dup is false, an error will be raised if an object # with the given id already exists. If allow_dup is true, # only check that the id string contains no illegal chars. becomes: def _checkId(self, id, allow_dup=1): # If allow_dup is false, an error will be raised if an object # with the given id already exists. If allow_dup is true, # only check that the id string contains no illegal chars. which also works. Only drawback now is that the entire contents of directories is deleted when you up^load the updated directory. Oleg Broytmann wrote:
On Fri, 4 Feb 2000, Maarten Slaets wrote:
i'm doing a weekly import of a certain site. i'm using load_site.py but, since its a weekly update, the files i'm importing are already there. the load_site gives me a 'The id %s is invalid - it is already in use.' error ofcourse. can anyone help me to make loadsite overwrite the existing objects?
Patch the load_site.py, wrap every call to manage_add with try/except, and on exception, do manage_edit instead. I'd recomment you to download later version of Zope and use recent load_site.py. You still nwill need to patch it. After testing your patches, please publish it here.
Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Maarten Slaets Web Developer KPNQwest Belgium http://www.fonky.com/vcard/MaartenSlaets/
Can somebody point me in the right direction for using load_site.py? I've got a zope server running with several additional sites I'd like to incorporate without having to manually load them into Zope... Thanks, Josua Brauer ___________________________________________ Joshua Brauer Computer Support Scientist Department of Biochemistry and Molecular Biology Colorado State University Fort Collins, CO 80523 (970) 491-1080
participants (3)
-
joshb@brauer.org -
Maarten Slaets -
Oleg Broytmann