Skip to content

Commit

Permalink
PEP8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioo committed Jan 15, 2015
1 parent 6b4edcc commit 934525f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
10 changes: 7 additions & 3 deletions modoboa/extensions/radicale/__init__.py
Expand Up @@ -3,9 +3,11 @@
"""
import sys

from django.contrib.auth.models import Permission, Group
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy

from modoboa.lib import events, parameters
from modoboa.lib.permissions import add_permissions_to_group
from modoboa.core.extensions import ModoExtension, exts_pool
Expand All @@ -28,14 +30,16 @@ def init_limits_dependant_features():


class Radicale(ModoExtension):
"""
"""

"""Radicale extension declaration."""

name = "radicale"
label = ugettext_lazy("Radicale management")
version = "1.0"
url = "calendars"
description = ugettext_lazy(
"Management frontend for Radicale, a simple calendar and contact server."
"Management frontend for Radicale, a simple calendar and contact "
"server."
)

def init(self):
Expand Down
8 changes: 5 additions & 3 deletions modoboa/extensions/radicale/forms.py
@@ -1,13 +1,15 @@
"""
Radicale extension forms.
"""

from django import forms
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _, ugettext_lazy
from modoboa.lib.web_utils import render_to_json_response
from modoboa.lib.form_utils import WizardForm, TabForms, DynamicForm

from modoboa.extensions.admin.models import Domain, Mailbox
from modoboa.extensions.radicale.models import UserCalendar, SharedCalendar
from modoboa.lib.form_utils import WizardForm, TabForms, DynamicForm
from modoboa.lib.web_utils import render_to_json_response


class UserCalendarForm(forms.ModelForm):
Expand Down Expand Up @@ -122,7 +124,7 @@ def save(self):
pos = int(res.group(1)) if res else None
usernames[value] = pos
for rule in self.calendar.rules.select_related().all():
if not rule.mailbox.full_address in usernames:
if rule.mailbox.full_address not in usernames:
rule.delete()
for username, pos in usernames.iteritems():
local_part, domname = split_mailbox(username)
Expand Down
8 changes: 5 additions & 3 deletions modoboa/extensions/radicale/templatetags/radicale_tags.py
Expand Up @@ -2,15 +2,17 @@
Custom template tags.
"""
from django import template
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from modoboa.lib.web_utils import render_actions

from modoboa.lib.templatetags.lib_tags import render_link
from modoboa.lib.web_utils import render_actions


register = template.Library()


@register.simple_tag
def radicale_left_menu(user):
"""Menu located inside the left column.
Expand Down Expand Up @@ -96,7 +98,7 @@ def render_rule_fields(form):
result = ""
while True:
fname = "username_%d" % cpt
if not fname in form.fields:
if fname not in form.fields:
break
rfieldname = "read_access_%d" % cpt
wfieldname = "write_access_%d" % cpt
Expand Down

0 comments on commit 934525f

Please sign in to comment.