| OLD | NEW |
| 1 """distutils.pypirc | 1 """distutils.pypirc |
| 2 | 2 |
| 3 Provides the PyPIRCCommand class, the base class for the command classes | 3 Provides the PyPIRCCommand class, the base class for the command classes |
| 4 that uses .pypirc in the distutils.command package. | 4 that uses .pypirc in the distutils.command package. |
| 5 """ | 5 """ |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 from configparser import ConfigParser | 8 from configparser import ConfigParser |
| 9 | 9 |
| 10 from distutils.cmd import Command | 10 from distutils.cmd import Command |
| 11 | 11 |
| 12 DEFAULT_PYPIRC = """\ | 12 DEFAULT_PYPIRC = """\ |
| 13 [distutils] | 13 [distutils] |
| 14 index-servers = | 14 index-servers = |
| 15 pypi | 15 pypi |
| 16 | 16 |
| 17 [pypi] | 17 [pypi] |
| 18 username:%s | 18 username:%s |
| 19 password:%s | 19 password:%s |
| 20 """ | 20 """ |
| 21 | 21 |
| 22 class PyPIRCCommand(Command): | 22 class PyPIRCCommand(Command): |
| 23 """Base command that knows how to handle the .pypirc file | 23 """Base command that knows how to handle the .pypirc file |
| 24 """ | 24 """ |
| 25 DEFAULT_REPOSITORY = 'http://pypi.python.org/pypi' | 25 DEFAULT_REPOSITORY = 'https://pypi.python.org/pypi' |
| 26 DEFAULT_REALM = 'pypi' | 26 DEFAULT_REALM = 'pypi' |
| 27 repository = None | 27 repository = None |
| 28 realm = None | 28 realm = None |
| 29 | 29 |
| 30 user_options = [ | 30 user_options = [ |
| 31 ('repository=', 'r', | 31 ('repository=', 'r', |
| 32 "url of repository [default: %s]" % \ | 32 "url of repository [default: %s]" % \ |
| 33 DEFAULT_REPOSITORY), | 33 DEFAULT_REPOSITORY), |
| 34 ('show-response', None, | 34 ('show-response', None, |
| 35 'display full response text from server')] | 35 'display full response text from server')] |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 self.repository = None | 115 self.repository = None |
| 116 self.realm = None | 116 self.realm = None |
| 117 self.show_response = 0 | 117 self.show_response = 0 |
| 118 | 118 |
| 119 def finalize_options(self): | 119 def finalize_options(self): |
| 120 """Finalizes options.""" | 120 """Finalizes options.""" |
| 121 if self.repository is None: | 121 if self.repository is None: |
| 122 self.repository = self.DEFAULT_REPOSITORY | 122 self.repository = self.DEFAULT_REPOSITORY |
| 123 if self.realm is None: | 123 if self.realm is None: |
| 124 self.realm = self.DEFAULT_REALM | 124 self.realm = self.DEFAULT_REALM |
| OLD | NEW |