Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
HashError Class Reference
Inheritance diagram for HashError:
Collaboration diagram for HashError:

Public Member Functions

str body (self)
 
str __str__ (self)
 

Data Fields

 req
 

Static Public Attributes

Optional req = None
 
str head = ""
 
int order = -1
 

Protected Member Functions

str _requirement_name (self)
 

Detailed Description

A failure to verify a package against known-good hashes

:cvar order: An int sorting hash exception classes by difficulty of
    recovery (lower being harder), so the user doesn't bother fretting
    about unpinned packages when he has deeper issues, like VCS
    dependencies, to deal with. Also keeps error reports in a
    deterministic order.
:cvar head: A section heading for display above potentially many
    exceptions of this kind
:ivar req: The InstallRequirement that triggered this error. This is
    pasted on after the exception is instantiated, because it's not
    typically available earlier.

Definition at line 447 of file exceptions.py.

Member Function Documentation

◆ __str__()

str __str__ (   self)

Definition at line 480 of file exceptions.py.

480 def __str__(self) -> str:
481 return f"{self.head}\n{self.body()}"
482

◆ _requirement_name()

str _requirement_name (   self)
protected
Return a description of the requirement that triggered me.

This default implementation returns long description of the req, with
line numbers

Definition at line 483 of file exceptions.py.

483 def _requirement_name(self) -> str:
484 """Return a description of the requirement that triggered me.
485
486 This default implementation returns long description of the req, with
487 line numbers
488
489 """
490 return str(self.req) if self.req else "unknown package"
491
492

◆ body()

str body (   self)
Return a summary of me for display under the heading.

This default implementation simply prints a description of the
triggering requirement.

:param req: The InstallRequirement that provoked this error, with
    its link already populated by the resolver's _populate_link().

Reimplemented in HashMissing, and HashMismatch.

Definition at line 468 of file exceptions.py.

468 def body(self) -> str:
469 """Return a summary of me for display under the heading.
470
471 This default implementation simply prints a description of the
472 triggering requirement.
473
474 :param req: The InstallRequirement that provoked this error, with
475 its link already populated by the resolver's _populate_link().
476
477 """
478 return f" {self._requirement_name()}"
479

Referenced by PreparedRequest.copy(), PreparedRequest.prepare_auth(), and PreparedRequest.prepare_body().

Here is the caller graph for this function:

Field Documentation

◆ head

str head = ""
static

Definition at line 465 of file exceptions.py.

◆ order

int order = -1
static

Definition at line 466 of file exceptions.py.

◆ req [1/2]

◆ req [2/2]


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