MCPcopy Create free account
hub / github.com/Relento/lego_release / begin_html

Method begin_html

tu/loggers/html_table.py:60–81  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 self.end_html()
59
60 def begin_html(self):
61 # if osp.isfile(self.visdir):
62 # raise FileExistsError('Visualization dir "{}" is a file.'.format(self.visdir))
63 # elif osp.isdir(self.visdir) and osp.isfile(self.get_index_filename()):
64 # if yes_or_no('Visualization dir "{}" is not empty. Do you want to overwrite?'.format(self.visdir)):
65 # shutil.rmtree(self.visdir)
66 # else:
67 # raise FileExistsError('Visualization dir "{}" already exists.'.format(self.visdir))
68 #
69 os.makedirs(self.visdir, exist_ok=True)
70 os.makedirs(os.path.join(self.visdir, 'assets'), exist_ok=True)
71 self._index_file = open(self.get_index_filename(), 'w')
72 self._print('<html>')
73 self._print('<head>')
74 self._print('<title>{}</title>'.format(self.title))
75 self._print('<style>')
76 self._print('td {vertical-align:top;padding:5px}')
77 self._print('</style>')
78 self._print('</head>')
79 self._print('<body>')
80 self._print('<h1>{}</h1>'.format(self.title))
81 self._print(self.FRAMES_JS)
82
83 def end_html(self):
84 self._print('</body>')

Callers 2

htmlMethod · 0.95
setUpClassMethod · 0.45

Calls 2

get_index_filenameMethod · 0.95
_printMethod · 0.95

Tested by 1

setUpClassMethod · 0.36