Coverage for aipyapp/exec/html.py: 42%

12 statements  

« prev     ^ index     » next       coverage.py v7.10.3, created at 2025-08-11 12:02 +0200

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3 

4import webbrowser 

5 

6class HtmlExecutor(): 

7 name = 'html' 

8 

9 def __init__(self, runtime=None): 

10 self.runtime = runtime 

11 

12 def __call__(self, block): 

13 abs_path = block.abs_path 

14 if abs_path: 

15 # Open the HTML file in a web browser 

16 import webbrowser 

17 webbrowser.open(f'file://{abs_path}') 

18 

19 result = {'stdout': 'OK'} 

20 return result