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

1#!/usr/bin/env python

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

3

4 import webbrowser

5

6 class 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