| Server IP : 199.250.200.62 / Your IP : 216.73.216.15 Web Server : Apache System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 User : jasonp18 ( 1000) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/cwd/proc/2/cwd/proc/2/root/opt/imh-python/lib/python3.9/site-packages/pygraph/ |
Upload File : |
"""Exceptions used by the library."""
class PygraphError(Exception):
"""Root exception class for all library exceptions. Only used for subclassing."""
pass
class NonexistentNodeError(PygraphError):
"""Thrown when a node does not exist within a graph."""
def __init__(self, node_id):
self.node_id = node_id
def __str__(self):
return 'Node "{}" does not exist.'.format(self.node_id)
class NonexistentEdgeError(PygraphError):
"""Thrown when an edge does not exist within a graph."""
def __init__(self, edge_id):
self.edge_id = edge_id
def __str__(self):
return 'Edge "{}" does not exist.'.format(self.edge_id)
class DisconnectedGraphError(PygraphError):
"""Thrown when a graph is disconnected (and such is unexpected by an algorithm)."""
pass