MCPcopy Create free account
hub / github.com/NVlabs/SPADE / __init__

Method __init__

util/html.py:13–32  ·  view source on GitHub ↗
(self, web_dir, title, refresh=0)

Source from the content-addressed store, hash-verified

11
12class HTML:
13 def __init__(self, web_dir, title, refresh=0):
14 if web_dir.endswith('.html'):
15 web_dir, html_name = os.path.split(web_dir)
16 else:
17 web_dir, html_name = web_dir, 'index.html'
18 self.title = title
19 self.web_dir = web_dir
20 self.html_name = html_name
21 self.img_dir = os.path.join(self.web_dir, 'images')
22 if len(self.web_dir) > 0 and not os.path.exists(self.web_dir):
23 os.makedirs(self.web_dir)
24 if len(self.web_dir) > 0 and not os.path.exists(self.img_dir):
25 os.makedirs(self.img_dir)
26
27 self.doc = dominate.document(title=title)
28 with self.doc:
29 h1(datetime.datetime.now().strftime("%I:%M%p on %B %d, %Y"))
30 if refresh > 0:
31 with self.doc.head:
32 meta(http_equiv="refresh", content=str(refresh))
33
34 def get_image_dir(self):
35 return self.img_dir

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected