コード例 #1
0
ファイル: test_util.py プロジェクト: irslambouf/SyncServer
    def test_server_registration(self):
        # This test makes sure we know how to:
        # 1. handle several sections in .pypirc
        # 2. handle the old format

        # new format
        self.write_file(self.rc, PYPIRC)
        config = read_pypirc()

        config = config.items()
        config.sort()
        expected = [('password', 'xxxx'), ('realm', 'pypi'),
                    ('repository', 'http://pypi.python.org/pypi'),
                    ('server', 'pypi'), ('username', 'me')]
        self.assertEqual(config, expected)

        # old format
        self.write_file(self.rc, PYPIRC_OLD)
        config = read_pypirc()
        config = config.items()
        config.sort()
        expected = [('password', 'secret'), ('realm', 'pypi'),
                    ('repository', 'http://pypi.python.org/pypi'),
                    ('server', 'server-login'), ('username', 'tarek')]
        self.assertEqual(config, expected)
コード例 #2
0
ファイル: register.py プロジェクト: dstufft/distutils2
 def _set_config(self):
     ''' Reads the configuration file and set attributes.
     '''
     config = read_pypirc(self.repository, self.realm)
     if config != {}:
         self.username = config['username']
         self.password = config['password']
         self.repository = config['repository']
         self.realm = config['realm']
         self.has_config = True
     else:
         if self.repository not in ('pypi', DEFAULT_REPOSITORY):
             raise ValueError('%s not found in .pypirc' % self.repository)
         if self.repository == 'pypi':
             self.repository = DEFAULT_REPOSITORY
         self.has_config = False
コード例 #3
0
ファイル: register.py プロジェクト: Arturo0911/water-quality
 def _set_config(self):
     ''' Reads the configuration file and set attributes.
     '''
     config = read_pypirc(self.repository, self.realm)
     if config != {}:
         self.username = config['username']
         self.password = config['password']
         self.repository = config['repository']
         self.realm = config['realm']
         self.has_config = True
     else:
         if self.repository not in ('pypi', DEFAULT_REPOSITORY):
             raise ValueError('%s not found in .pypirc' % self.repository)
         if self.repository == 'pypi':
             self.repository = DEFAULT_REPOSITORY
         self.has_config = False
コード例 #4
0
 def finalize_options(self):
     if self.repository is None:
         self.repository = DEFAULT_REPOSITORY
     if self.realm is None:
         self.realm = DEFAULT_REALM
     if self.upload_dir is None:
         build = self.get_finalized_command('build')
         self.upload_dir = os.path.join(build.build_base, "docs")
         if not os.path.isdir(self.upload_dir):
             self.upload_dir = os.path.join(build.build_base, "doc")
     logger.info('Using upload directory %s', self.upload_dir)
     self.verify_upload_dir(self.upload_dir)
     config = read_pypirc(self.repository, self.realm)
     if config != {}:
         self.username = config['username']
         self.password = config['password']
         self.repository = config['repository']
         self.realm = config['realm']
コード例 #5
0
ファイル: upload_docs.py プロジェクト: dstufft/distutils2
 def finalize_options(self):
     if self.repository is None:
         self.repository = DEFAULT_REPOSITORY
     if self.realm is None:
         self.realm = DEFAULT_REALM
     if self.upload_dir is None:
         build = self.get_finalized_command('build')
         self.upload_dir = os.path.join(build.build_base, "docs")
         if not os.path.isdir(self.upload_dir):
             self.upload_dir = os.path.join(build.build_base, "doc")
     logger.info('Using upload directory %s', self.upload_dir)
     self.verify_upload_dir(self.upload_dir)
     config = read_pypirc(self.repository, self.realm)
     if config != {}:
         self.username = config['username']
         self.password = config['password']
         self.repository = config['repository']
         self.realm = config['realm']
コード例 #6
0
    def finalize_options(self):
        if self.repository is None:
            self.repository = DEFAULT_REPOSITORY
        if self.realm is None:
            self.realm = DEFAULT_REALM
        if self.identity and not self.sign:
            raise PackagingOptionError(
                "Must use --sign for --identity to have meaning")
        config = read_pypirc(self.repository, self.realm)
        if config != {}:
            self.username = config['username']
            self.password = config['password']
            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
コード例 #7
0
ファイル: upload.py プロジェクト: dstufft/distutils2
    def finalize_options(self):
        if self.repository is None:
            self.repository = DEFAULT_REPOSITORY
        if self.realm is None:
            self.realm = DEFAULT_REALM
        if self.identity and not self.sign:
            raise PackagingOptionError(
                "Must use --sign for --identity to have meaning")
        config = read_pypirc(self.repository, self.realm)
        if config != {}:
            self.username = config['username']
            self.password = config['password']
            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