Changeset View
Changeset View
Standalone View
Standalone View
pykolab/plugins/dynamicquota/__init__.py
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | def set_user_folder_quota(self, *args, **kw): | ||||
- None - an error has occurred and this plugin doesn't care. | - None - an error has occurred and this plugin doesn't care. | ||||
- Negative 1 - remove quota. | - Negative 1 - remove quota. | ||||
- Zero - Absolute 0. | - Zero - Absolute 0. | ||||
- Positive Integer - set new quota. | - Positive Integer - set new quota. | ||||
""" | """ | ||||
for keyword in [ 'used', 'imap_quota', 'ldap_quota', 'default_quota' ]: | for keyword in [ 'used', 'imap_quota', 'ldap_quota', 'default_quota' ]: | ||||
if not kw.has_key(keyword): | if keyword not in kw: | ||||
log.warning( | log.warning( | ||||
_("No keyword %s passed to set_user_folder_quota") % ( | _("No keyword %s passed to set_user_folder_quota") % ( | ||||
keyword | keyword | ||||
) | ) | ||||
) | ) | ||||
return | return | ||||
else: | else: | ||||
Show All 9 Lines | def set_user_folder_quota(self, *args, **kw): | ||||
if kw['ldap_quota'] == None: | if kw['ldap_quota'] == None: | ||||
return kw['default_quota'] | return kw['default_quota'] | ||||
elif kw['ldap_quota'] == -1: | elif kw['ldap_quota'] == -1: | ||||
return -1 | return -1 | ||||
elif kw['ldap_quota'] > 0: | elif kw['ldap_quota'] > 0: | ||||
return kw['ldap_quota'] | return kw['ldap_quota'] | ||||
else: | else: | ||||
return kw['default_quota'] | return kw['default_quota'] | ||||
No newline at end of file | No newline at end of file |