Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
pip._vendor.distlib.index.PackageIndex Class Reference
Inheritance diagram for pip._vendor.distlib.index.PackageIndex:
Inheritance graph
[legend]
Collaboration diagram for pip._vendor.distlib.index.PackageIndex:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self, url=None)
 
 read_configuration (self)
 
 save_configuration (self)
 
 check_credentials (self)
 
 register (self, metadata)
 
 get_sign_command (self, filename, signer, sign_password, keystore=None)
 
 run_command (self, cmd, input_data=None)
 
 sign_file (self, filename, signer, sign_password, keystore=None)
 
 upload_file (self, metadata, filename, signer=None, sign_password=None, filetype='sdist', pyversion='source', keystore=None)
 
 upload_documentation (self, metadata, doc_dir)
 
 get_verify_command (self, signature_filename, data_filename, keystore=None)
 
 verify_signature (self, signature_filename, data_filename, keystore=None)
 
 download_file (self, url, destfile, digest=None, reporthook=None)
 
 send_request (self, req)
 
 encode_request (self, fields, files)
 
 search (self, terms, operator=None)
 

Public Attributes

 url
 
 password_handler
 
 ssl_verifier
 
 gpg
 
 gpg_home
 
 username
 
 password
 
 realm
 

Static Public Attributes

str boundary = b'----------ThIs_Is_tHe_distlib_index_bouNdaRY_$'
 

Protected Member Functions

 _get_pypirc_command (self)
 
 _reader (self, name, stream, outbuf)
 

Detailed Description

This class represents a package index compatible with PyPI, the Python
Package Index.

Constructor & Destructor Documentation

◆ __init__()

pip._vendor.distlib.index.PackageIndex.__init__ (   self,
  url = None 
)
Initialise an instance.

:param url: The URL of the index. If not specified, the URL for PyPI is
            used.

Member Function Documentation

◆ _get_pypirc_command()

pip._vendor.distlib.index.PackageIndex._get_pypirc_command (   self)
protected
Get the distutils command for interacting with PyPI configurations.
:return: the command.

◆ _reader()

pip._vendor.distlib.index.PackageIndex._reader (   self,
  name,
  stream,
  outbuf 
)
protected
Thread runner for reading lines of from a subprocess into a buffer.

:param name: The logical name of the stream (used for logging only).
:param stream: The stream to read from. This will typically a pipe
               connected to the output stream of a subprocess.
:param outbuf: The list to append the read lines to.

◆ check_credentials()

pip._vendor.distlib.index.PackageIndex.check_credentials (   self)
Check that ``username`` and ``password`` have been set, and raise an
exception if not.

◆ download_file()

pip._vendor.distlib.index.PackageIndex.download_file (   self,
  url,
  destfile,
  digest = None,
  reporthook = None 
)
This is a convenience method for downloading a file from an URL.
Normally, this will be a file from the index, though currently
no check is made for this (i.e. a file can be downloaded from
anywhere).

The method is just like the :func:`urlretrieve` function in the
standard library, except that it allows digest computation to be
done during download and checking that the downloaded data
matched any expected value.

:param url: The URL of the file to be downloaded (assumed to be
            available via an HTTP GET request).
:param destfile: The pathname where the downloaded file is to be
                 saved.
:param digest: If specified, this must be a (hasher, value)
               tuple, where hasher is the algorithm used (e.g.
               ``'md5'``) and ``value`` is the expected value.
:param reporthook: The same as for :func:`urlretrieve` in the
                   standard library.

◆ encode_request()

pip._vendor.distlib.index.PackageIndex.encode_request (   self,
  fields,
  files 
)
Encode fields and files for posting to an HTTP server.

:param fields: The fields to send as a list of (fieldname, value)
               tuples.
:param files: The files to send as a list of (fieldname, filename,
              file_bytes) tuple.

◆ get_sign_command()

pip._vendor.distlib.index.PackageIndex.get_sign_command (   self,
  filename,
  signer,
  sign_password,
  keystore = None 
)
Return a suitable command for signing a file.

:param filename: The pathname to the file to be signed.
:param signer: The identifier of the signer of the file.
:param sign_password: The passphrase for the signer's
                      private key used for signing.
:param keystore: The path to a directory which contains the keys
                 used in verification. If not specified, the
                 instance's ``gpg_home`` attribute is used instead.
:return: The signing command as a list suitable to be
         passed to :class:`subprocess.Popen`.

◆ get_verify_command()

pip._vendor.distlib.index.PackageIndex.get_verify_command (   self,
  signature_filename,
  data_filename,
  keystore = None 
)
Return a suitable command for verifying a file.

:param signature_filename: The pathname to the file containing the
                           signature.
:param data_filename: The pathname to the file containing the
                      signed data.
:param keystore: The path to a directory which contains the keys
                 used in verification. If not specified, the
                 instance's ``gpg_home`` attribute is used instead.
:return: The verifying command as a list suitable to be
         passed to :class:`subprocess.Popen`.

◆ read_configuration()

pip._vendor.distlib.index.PackageIndex.read_configuration (   self)
Read the PyPI access configuration as supported by distutils. This populates
``username``, ``password``, ``realm`` and ``url`` attributes from the
configuration.

◆ register()

pip._vendor.distlib.index.PackageIndex.register (   self,
  metadata 
)
Register a distribution on PyPI, using the provided metadata.

:param metadata: A :class:`Metadata` instance defining at least a name
                 and version number for the distribution to be
                 registered.
:return: The HTTP response received from PyPI upon submission of the
        request.

◆ run_command()

pip._vendor.distlib.index.PackageIndex.run_command (   self,
  cmd,
  input_data = None 
)
Run a command in a child process , passing it any input data specified.

:param cmd: The command to run.
:param input_data: If specified, this must be a byte string containing
                   data to be sent to the child process.
:return: A tuple consisting of the subprocess' exit code, a list of
         lines read from the subprocess' ``stdout``, and a list of
         lines read from the subprocess' ``stderr``.

◆ save_configuration()

pip._vendor.distlib.index.PackageIndex.save_configuration (   self)
Save the PyPI access configuration. You must have set ``username`` and
``password`` attributes before calling this method.

◆ send_request()

pip._vendor.distlib.index.PackageIndex.send_request (   self,
  req 
)
Send a standard library :class:`Request` to PyPI and return its
response.

:param req: The request to send.
:return: The HTTP response from PyPI (a standard library HTTPResponse).

◆ sign_file()

pip._vendor.distlib.index.PackageIndex.sign_file (   self,
  filename,
  signer,
  sign_password,
  keystore = None 
)
Sign a file.

:param filename: The pathname to the file to be signed.
:param signer: The identifier of the signer of the file.
:param sign_password: The passphrase for the signer's
                      private key used for signing.
:param keystore: The path to a directory which contains the keys
                 used in signing. If not specified, the instance's
                 ``gpg_home`` attribute is used instead.
:return: The absolute pathname of the file where the signature is
         stored.

◆ upload_documentation()

pip._vendor.distlib.index.PackageIndex.upload_documentation (   self,
  metadata,
  doc_dir 
)
Upload documentation to the index.

:param metadata: A :class:`Metadata` instance defining at least a name
                 and version number for the documentation to be
                 uploaded.
:param doc_dir: The pathname of the directory which contains the
                documentation. This should be the directory that
                contains the ``index.html`` for the documentation.
:return: The HTTP response received from PyPI upon submission of the
        request.

◆ upload_file()

pip._vendor.distlib.index.PackageIndex.upload_file (   self,
  metadata,
  filename,
  signer = None,
  sign_password = None,
  filetype = 'sdist',
  pyversion = 'source',
  keystore = None 
)
Upload a release file to the index.

:param metadata: A :class:`Metadata` instance defining at least a name
                 and version number for the file to be uploaded.
:param filename: The pathname of the file to be uploaded.
:param signer: The identifier of the signer of the file.
:param sign_password: The passphrase for the signer's
                      private key used for signing.
:param filetype: The type of the file being uploaded. This is the
                distutils command which produced that file, e.g.
                ``sdist`` or ``bdist_wheel``.
:param pyversion: The version of Python which the release relates
                  to. For code compatible with any Python, this would
                  be ``source``, otherwise it would be e.g. ``3.2``.
:param keystore: The path to a directory which contains the keys
                 used in signing. If not specified, the instance's
                 ``gpg_home`` attribute is used instead.
:return: The HTTP response received from PyPI upon submission of the
        request.

◆ verify_signature()

pip._vendor.distlib.index.PackageIndex.verify_signature (   self,
  signature_filename,
  data_filename,
  keystore = None 
)
Verify a signature for a file.

:param signature_filename: The pathname to the file containing the
                           signature.
:param data_filename: The pathname to the file containing the
                      signed data.
:param keystore: The path to a directory which contains the keys
                 used in verification. If not specified, the
                 instance's ``gpg_home`` attribute is used instead.
:return: True if the signature was verified, else False.

The documentation for this class was generated from the following file: