Ignore:
Timestamp:
18 Nov 2014, 11:37:28 (10 years ago)
Author:
Henrik Bettermann
Message:

pep8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py

    r11979 r11985  
    5151grok.context(IIkobaObject)
    5252
     53
    5354class CustomersBreadcrumb(Breadcrumb):
    5455    """A breadcrumb for the customers container.
     
    7273    def title(self):
    7374        return self.context.display_fullname
     75
    7476
    7577class CustomersContainerPage(IkobaPage):
     
    112114            self.flash(_('No customer found.'), type="warning")
    113115        return
     116
    114117
    115118class CustomersContainerManagePage(IkobaPage):
     
    168171        if len(deleted):
    169172            self.flash(_('Successfully removed: ${a}',
    170                 mapping = {'a':', '.join(deleted)}))
    171         return
     173                mapping={'a': ','.join(deleted)}))
     174        return
     175
    172176
    173177class CustomerAddFormPage(IkobaAddFormPage):
     
    191195        return
    192196
     197
    193198class LoginAsCustomerStep1(IkobaEditFormPage):
    194199    """ View to temporarily set a customer password.
     
    202207    def label(self):
    203208        return _(u'Set temporary password for ${a}',
    204             mapping = {'a':self.context.display_fullname})
     209            mapping={'a': self.context.display_fullname})
    205210
    206211    @action('Set password now', style='primary')
     
    211216        self.context.writeLogMessage(
    212217            self, 'temp_password generated: %s' % password)
    213         args = {'password':password}
     218        args = {'password': password}
    214219        self.redirect(self.url(self.context) +
    215220            '/loginasstep2?%s' % urlencode(args))
    216221        return
     222
    217223
    218224class LoginAsCustomerStep2(IkobaPage):
     
    228234    def label(self):
    229235        return _(u'Login as ${a}',
    230             mapping = {'a':self.context.customer_id})
     236            mapping={'a': self.context.customer_id})
    231237
    232238    def update(self, SUBMIT=None, password=None):
     
    237243        return
    238244
     245
    239246class CustomerBaseDisplayFormPage(IkobaDisplayFormPage):
    240247    """ Page to display customer base data
     
    252259        if self.context.suspended:
    253260            return _('${a}: Base Data (account deactivated)',
    254                 mapping = {'a':self.context.display_fullname})
     261                mapping={'a': self.context.display_fullname})
    255262        return  _('${a}: Base Data',
    256             mapping = {'a':self.context.display_fullname})
     263            mapping={'a': self.context.display_fullname})
    257264
    258265    @property
     
    262269        return _('unset')
    263270
     271
    264272class ContactCustomerForm(ContactAdminForm):
    265273    grok.context(ICustomer)
     
    277285    def label(self):
    278286        return _(u'Send message to ${a}',
    279             mapping = {'a':self.context.display_fullname})
     287            mapping={'a': self.context.display_fullname})
    280288
    281289    @action('Send message now', style='primary')
     
    289297        ikoba_utils = getUtility(IIkobaUtils)
    290298        success = ikoba_utils.sendContactForm(
    291                 self.request.principal.title,email,
    292                 self.context.display_fullname,self.context.email,
     299                self.request.principal.title, email,
     300                self.context.display_fullname, self.context.email,
    293301                self.request.principal.id,usertype,
    294302                self.config.name,
    295                 data['body'],data['subject'])
     303                data['body'], data['subject'])
    296304        if success:
    297305            self.flash(_('Your message has been sent.'))
     
    299307            self.flash(_('An smtp server error occurred.'), type="danger")
    300308        return
     309
    301310
    302311class CustomerBaseManageFormPage(IkobaEditFormPage):
     
    326335            errors = validator.validate_password(password, password_ctl)
    327336            if errors:
    328                 self.flash( ' '.join(errors), type="danger")
     337                self.flash(' '.join(errors), type="danger")
    329338                return
    330339        changed_fields = self.applyData(self.context, **data)
     
    344353        return
    345354
     355
    346356class CustomerTriggerTransitionFormPage(IkobaEditFormPage):
    347357    """ View to manage customer base data
     
    375385        return
    376386
     387
    377388class CustomerActivatePage(UtilityView, grok.View):
    378389    """ Activate customer account
     
    394405        return
    395406
     407
    396408class CustomerDeactivatePage(UtilityView, grok.View):
    397409    """ Deactivate customer account
     
    413425        return
    414426
     427
    415428class CustomerHistoryPage(IkobaPage):
    416429    """ Page to display customer history
     
    424437    @property
    425438    def label(self):
    426         return _('${a}: History', mapping = {'a':self.context.display_fullname})
     439        return _('${a}: History', mapping={'a':self.context.display_fullname})
     440
    427441
    428442class CustomerRequestPasswordPage(IkobaAddFormPage):
     
    446460        # Forward only email to landing page in base package.
    447461        self.redirect(self.url(self.context, 'requestpw_complete',
    448             data = dict(email=email)))
     462            data=dict(email=email)))
    449463        return
    450464
     
    513527        return
    514528
     529
    515530class CustomerRequestPasswordEmailSent(IkobaPage):
    516531    """Landing page after successful password request.
     
    527542        self.customer_id = customer_id
    528543        return
     544
    529545
    530546class CustomerFilesUploadPage(IkobaPage):
     
    548564# Pages for customers only
    549565
     566
    550567class CustomerBaseEditFormPage(IkobaEditFormPage):
    551568    """ View to edit customer base data
     
    563580        msave(self, **data)
    564581        return
     582
    565583
    566584class CustomerChangePasswordPage(IkobaEditFormPage):
     
    587605                self.flash(_('Password changed.'))
    588606            else:
    589                 self.flash( ' '.join(errors), type="warning")
    590         return
    591 
     607                self.flash(' '.join(errors), type="warning")
     608        return
Note: See TracChangeset for help on using the changeset viewer.