diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-01-09 00:15:45 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-01-09 00:15:45 (GMT) |
commit | 13f7c3b6cad28ee57390c7650e1bf644f0b3943f (patch) | |
tree | f74d6310917922466929bc468f2d9ee64300d2be /Lib/distutils/command | |
parent | bcd5cbe01ef4306a82f85d0500f9a9f04113f804 (diff) | |
download | cpython-13f7c3b6cad28ee57390c7650e1bf644f0b3943f.zip cpython-13f7c3b6cad28ee57390c7650e1bf644f0b3943f.tar.gz cpython-13f7c3b6cad28ee57390c7650e1bf644f0b3943f.tar.bz2 |
Merged revisions 68415 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r68415 | tarek.ziade | 2009-01-09 00:56:31 +0100 (Fri, 09 Jan 2009) | 1 line
fixed #4394 make the storage of the password optional in .pypirc
........
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/register.py | 30 | ||||
-rw-r--r-- | Lib/distutils/command/upload.py | 5 |
2 files changed, 22 insertions, 13 deletions
diff --git a/Lib/distutils/command/register.py b/Lib/distutils/command/register.py index 30e9a37..c271b18 100644 --- a/Lib/distutils/command/register.py +++ b/Lib/distutils/command/register.py @@ -174,19 +174,23 @@ Your selection [default 1]: ''', log.INFO) log.INFO) # possibly save the login - if not self.has_config and code == 200: - self.announce(('I can store your PyPI login so future ' - 'submissions will be faster.'), log.INFO) - self.announce('(the login will be stored in %s)' % \ - self._get_rc_file(), log.INFO) - - choice = 'X' - while choice.lower() not in 'yn': - choice = input('Save your login (y/N)?') - if not choice: - choice = 'n' - if choice.lower() == 'y': - self._store_pypirc(username, password) + if code == 200: + if self.has_config: + # sharing the password in the distribution instance + # so the upload command can reuse it + self.distribution.password = password + else: + self.announce(('I can store your PyPI login so future ' + 'submissions will be faster.'), log.INFO) + self.announce('(the login will be stored in %s)' % \ + self._get_rc_file(), log.INFO) + choice = 'X' + while choice.lower() not in 'yn': + choice = input('Save your login (y/N)?') + if not choice: + choice = 'n' + if choice.lower() == 'y': + self._store_pypirc(username, password) elif choice == '2': data = {':action': 'user'} diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py index 7ba7f58..020e860 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -48,6 +48,11 @@ class upload(PyPIRCCommand): self.repository = config['repository'] self.realm = config['realm'] + # getting the password from the distribution + # if previously set by the register command + if not self.password and self.distribution.password: + self.password = self.distribution.password + def run(self): if not self.distribution.dist_files: raise DistutilsOptionError("No dist file created in earlier command") |