VirtualMailManager/cli/handler.py
branchv0.7.x
changeset 686 5f4abdab738e
parent 676 2bc11dada296
child 711 2a75058fc064
equal deleted inserted replaced
685:c6024bc1de0f 686:5f4abdab738e
    64             self._cfg.configure([section])
    64             self._cfg.configure([section])
    65         else:
    65         else:
    66             raise VMMError(_("Invalid section: '%s'") % section,
    66             raise VMMError(_("Invalid section: '%s'") % section,
    67                            INVALID_SECTION)
    67                            INVALID_SECTION)
    68 
    68 
    69     def user_add(self, emailaddress, password=None):
    69     def user_add(self, emailaddress, password=None, note=None):
    70         """Override the parent user_add() - add the interactive password
    70         """Override the parent user_add() - add the interactive password
    71         dialog.
    71         dialog.
    72 
    72 
    73         Returns the generated password, if account.random_password == True.
    73         Returns the generated password, if account.random_password == True.
    74         """
    74         """
    79         self._is_other_address(acc.address, TYPE_ACCOUNT)
    79         self._is_other_address(acc.address, TYPE_ACCOUNT)
    80         rand_pass = self._cfg.dget('account.random_password')
    80         rand_pass = self._cfg.dget('account.random_password')
    81         if password is None:
    81         if password is None:
    82             password = (read_pass, randompw)[rand_pass]()
    82             password = (read_pass, randompw)[rand_pass]()
    83         acc.set_password(password)
    83         acc.set_password(password)
       
    84         if note:
       
    85             acc.set_note(note)
    84         acc.save()
    86         acc.save()
    85         self._make_account_dirs(acc)
    87         self._make_account_dirs(acc)
    86         return (None, password)[rand_pass]
    88         return (None, password)[rand_pass]
    87 
    89 
    88     def user_password(self, emailaddress, password=None):
    90     def user_password(self, emailaddress, password=None):