Skip to content

shell: textblock displays the amount of time ctrl-c was pressed

Valentin Valls requested to merge twice-abort-with-textblock into master

Display the amout of time ctrl-c was pressed in the textblock toolbar

textblock

Here is the test i have used

from bliss.shell.pt.text_block_app import TextBlockApplication
from bliss.common.greenlet_utils.killmask import KillMask     
import gevent                                                 
interrupted = False                                           

def process():                                                
    global interrupted                                        
    try:                                                      
        with KillMask(masked_kill_nb=1):                      
            gevent.sleep(20.0)                                
    except BaseException:                                     
        interrupted = True                                    
        gevent.sleep(5.0)                                     
        raise                                                 

def render():                                                 
    import time                                               
    return 1, f"{time.time()}"                                
                                                              
app = TextBlockApplication(                                   
    render=render,                                            
    refresh_interval=0.3,                                     
)                                                             
app.exec(process=process)                                     
Edited by Valentin Valls

Merge request reports