[MERGE] Patch: smtp_connection.py
Aaron Bentley
aaron at aaronbentley.com
Wed May 6 15:37:02 BST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Amit Saha wrote:
>> Please submit a patch that makes only the changes you want.
>
> Please find the patch attached. Sorry for the earlier trouble.
bb:resubmit
Please update NEWS to mention this change.
> === modified file 'bzrlib/smtp_connection.py'
> --- bzrlib/smtp_connection.py 2009-04-27 16:10:10 +0000
> +++ bzrlib/smtp_connection.py 2009-05-06 14:08:02 +0000
> @@ -20,6 +20,7 @@
> import errno
> import smtplib
> import socket
> +import getpass
Please use bzrlib.ui.ui_factory.get_password instead of getpass. (Not
all bzrlib clients are console-based)
>
> from bzrlib import (
> config,
> @@ -56,6 +57,11 @@
> self._smtp_username = config.get_user_option('smtp_username')
> self._smtp_password = config.get_user_option('smtp_password')
>
> + """ If the password is not found in the configuration file, then prompt the user"""
Please use # for comments, not docstrings.
> +
> + if self._smtp_password is "":
Please compare strings with ==, not is.
> + self._smtp_password = getpass.getpass("Enter SMTP password")
> +
> self._connection = None
>
> def _connect(self):
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkoBoIoACgkQ0F+nu1YWqI19mQCggjjthjTxkC5Ns7V7y72mmpnP
DCAAniqcIPZdL0MecZwnj7XQwHKaUOwR
=t50r
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list