[CMF-checkins] CVS: CMF/CMFCalendar/Extensions - Install.py:1.5
Andrew Sawyers
andrew@zope.com
Fri, 28 Sep 2001 15:24:55 -0400
Update of /cvs-repository/CMF/CMFCalendar/Extensions
In directory cvs.zope.org:/tmp/cvs-serv24754
Modified Files:
Install.py
Log Message:
*added try/except around adding index's, columns, and metadata
policy's in case someone has already installed and are using the
calendar to allow for running the installation setup multiple
times.
=== CMF/CMFCalendar/Extensions/Install.py 1.4 => 1.5 ===
# Zope 2.3 and below
addColumn = catalog._catalog.addColumn
- addIndex('start', 'FieldIndex')
- addIndex('end', 'FieldIndex')
- addColumn('start')
- addColumn('end')
+ try:
+ addIndex('start', 'FieldIndex')
+ except: pass
+ try:
+ addIndex('end', 'FieldIndex')
+ except: pass
+ try:
+ addColumn('start')
+ except: pass
+ try:
+ addColumn('end')
+ except: pass
out.write('Added "start" and "end" field indexes and columns to '\
'the portal_catalog\n')
@@ -150,17 +158,19 @@
t['id']))
# Setup a MetadataTool Element Policy for Events
- metadatatool.addElementPolicy(
- element='Subject',
- content_type='Event',
- is_required=0,
- supply_default=0,
- default_value='',
- enforce_vocabulary=0,
- allowed_vocabulary=('Appointment', 'Convention', 'Meeting',
- 'Social Event', 'Work'),
- REQUEST=None,
- )
+ try:
+ metadatatool.addElementPolicy(
+ element='Subject',
+ content_type='Event',
+ is_required=0,
+ supply_default=0,
+ default_value='',
+ enforce_vocabulary=0,
+ allowed_vocabulary=('Appointment', 'Convention', 'Meeting',
+ 'Social Event', 'Work'),
+ REQUEST=None,
+ )
+ except: pass
out.write('Event added to Metdata element Policies\n')