MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / netlist2html

Function netlist2html

SLiCAP/SLiCAPhtml.py:281–303  ·  view source on GitHub ↗

Places the netlist of the circuit file 'fileName' on the active HTML page. The file must be located in the ini.cir_path folder. :param fileName: Name of the netlist file :type fileName: str :param label: Label ID for this object. :type label: str :return:

(fileName, label='', labelText ='')

Source from the content-addressed store, hash-verified

279 return html
280
281def netlist2html(fileName, label='', labelText =''):
282 """
283 Places the netlist of the circuit file 'fileName' on the active HTML page.
284 The file must be located in the ini.cir_path folder.
285
286 :param fileName: Name of the netlist file
287 :type fileName: str
288
289 :param label: Label ID for this object.
290 :type label: str
291
292 :return: HTML string that will be placed on the page.
293 :rtype: str
294 """
295 try:
296 label = _addLabel(label, fileName=fileName, caption=labelText, labelType="data")
297 netlist = _readFile(ini.cir_path + fileName)
298 html = '<h2>' + label + 'Netlist: ' + fileName + '</h2>\n<pre>' + netlist + '</pre>\n'
299 html = _insertHTML(ini.html_path + ini.html_page, html)
300 except:
301 print("Error: could not open netlist file: '{0}'.".format(fileName))
302 html = ''
303 return html
304
305
306def lib2html(fileName, label='', lib='user'):

Callers 1

makeCircuitFunction · 0.90

Calls 4

_addLabelFunction · 0.85
_readFileFunction · 0.85
_insertHTMLFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected