Changeset View
Changeset View
Standalone View
Standalone View
pykolab/plugins/defaultfolders/__init__.py
Show All 37 Lines | class KolabDefaultfolders(object): | ||||
def create_user_folders(self, *args, **kw): | def create_user_folders(self, *args, **kw): | ||||
""" | """ | ||||
The arguments passed to the 'create_user_folders' hook: | The arguments passed to the 'create_user_folders' hook: | ||||
additional_folders - additional folders to create | additional_folders - additional folders to create | ||||
user_folder - user folder | user_folder - user folder | ||||
""" | """ | ||||
if not kw.has_key('additional_folders'): | if 'additional_folders' not in kw: | ||||
log.error(_("Plugin %s called without required keyword %s.") % ("defaultfolders", "additional_folders")) | log.error(_("Plugin %s called without required keyword %s.") % ("defaultfolders", "additional_folders")) | ||||
return {} | return {} | ||||
try: | try: | ||||
exec("additional_folders = %s" % (kw['additional_folders'])) | exec("additional_folders = %s" % (kw['additional_folders'])) | ||||
except Exception, e: | except Exception: | ||||
log.error(_("Could not parse additional_folders")) | log.error(_("Could not parse additional_folders")) | ||||
return {} | return {} | ||||
return additional_folders | return additional_folders |