RadCluster
Graph-based cluster dynamics for irradiated materials
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
py_utils.simulation._InterruptDeferred Class Reference
+ Collaboration diagram for py_utils.simulation._InterruptDeferred:

Public Member Functions

 __init__ (self, msg=('Ctrl+C — finishing pending writes before exit. ' 'Press Ctrl+C again to force-abort.'))
 
 __enter__ (self)
 
 __exit__ (self, exc_type, exc, tb)
 

Protected Member Functions

 _handler (self, signum, frame)
 

Protected Attributes

 _msg
 
 _caught
 
 _prev
 
 _active
 
 _handler
 

Detailed Description

Defer SIGINT through a critical save block.

First Ctrl+C inside the block prints a notice and continues — the save
finishes flushing partial output, then KeyboardInterrupt is re-raised
on exit.  A second Ctrl+C inside the same block restores the default
handler so the user can force-abort if a save step is hung.

Only used in main-thread Python contexts; signal.signal raises
ValueError off the main thread, so we silently fall back to a no-op.

Definition at line 126 of file simulation.py.

Constructor & Destructor Documentation

◆ __init__()

py_utils.simulation._InterruptDeferred.__init__ (   self,
  msg = ('Ctrl+C — finishing pending writes before exit. '                             'Press Ctrl+C again to force-abort.') 
)

Definition at line 139 of file simulation.py.

Member Function Documentation

◆ __enter__()

py_utils.simulation._InterruptDeferred.__enter__ (   self)

Definition at line 146 of file simulation.py.

◆ __exit__()

py_utils.simulation._InterruptDeferred.__exit__ (   self,
  exc_type,
  exc,
  tb 
)

Definition at line 172 of file simulation.py.

◆ _handler()

py_utils.simulation._InterruptDeferred._handler (   self,
  signum,
  frame 
)
protected

Definition at line 156 of file simulation.py.

Member Data Documentation

◆ _active

py_utils.simulation._InterruptDeferred._active
protected

Definition at line 144 of file simulation.py.

◆ _caught

py_utils.simulation._InterruptDeferred._caught
protected

Definition at line 142 of file simulation.py.

◆ _handler

py_utils.simulation._InterruptDeferred._handler
protected

Definition at line 149 of file simulation.py.

◆ _msg

py_utils.simulation._InterruptDeferred._msg
protected

Definition at line 141 of file simulation.py.

◆ _prev

py_utils.simulation._InterruptDeferred._prev
protected

Definition at line 143 of file simulation.py.


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