MCPcopy Index your code
hub / github.com/RedSiege/EyeWitness / create_table_html

Method create_table_html

Python/modules/objects.py:381–445  ·  view source on GitHub ↗
(self, divid)

Source from the content-addressed store, hash-verified

379 super(UAObject, self).set_paths(self.root_path, self.browser)
380
381 def create_table_html(self, divid):
382 scr_path = os.path.relpath(self.screenshot_path, self.root_path)
383 src_path = os.path.relpath(self.source_path, self.root_path)
384 html = u""
385 html += ("""<tr class="hide {0}">
386 <td><div style=\"display: inline-block; width: 300px; word-wrap: break-word\">
387 <a href=\"{1}\" target=\"_blank\">{1}</a><br>
388 """).format(divid, self.remote_system)
389
390 html += ("""
391 <br>This request was different from the baseline.<br>
392 The browser type is: <b>{0}</b><br><br>
393 The user agent is: <b>{1}</b><br><br>
394 Difference in length of the two webpage sources is\
395 : <b>{2}</b><br>
396 """).format(self.browser, self.ua, self.difference)
397
398 if self.ssl_error:
399 html += "<br><b>SSL Certificate error present on\
400 <a href=\"{0}\" target=\"_blank\">{0}</a></b><br>".format(
401 self.remote_system)
402
403 if self.default_creds is not None:
404 try:
405 html += "<br><b>Default credentials:</b> {0}<br>".format(
406 self.sanitize(self.default_creds))
407 except UnicodeEncodeError:
408 html += u"<br><b>Default credentials:</b> {0}<br>".format(
409 self.sanitize(self.default_creds))
410
411 try:
412 html += "\n<br><b> Page Title: </b>{0}\n".format(
413 self.sanitize(self.page_title))
414 except AttributeError:
415 html += "\n<br><b> Page Title:</b>{0}\n".format(
416 'Unable to Display')
417 except UnicodeDecodeError:
418 html += "\n<br><b> Page Title:</b>{0}\n".format(
419 'Unable to Display')
420 except UnicodeEncodeError:
421 html += u'<br><b> Page Title: </b>{0}\n'.format(
422 self.sanitize(self.page_title))
423
424 for key, value in self.headers.items():
425 try:
426 html += '<br><b> {0}:</b> {1}\n'.format(
427 self.sanitize(key), self.sanitize(value))
428 except UnicodeEncodeError:
429 html += u'<br><b> {0}:</b> {1}\n'.format(
430 self.sanitize(key), self.sanitize(value))
431
432 if self.blank:
433 html += ("""<br></td>
434 <td><div style=\"display: inline-block; width: 850px;\">Page Blank,\
435 Connection error, or SSL Issues</div></td>
436 </tr>
437 """)
438 else:

Callers 4

single_modeFunction · 0.45
create_table_htmlMethod · 0.45
sort_data_and_writeFunction · 0.45
search_reportFunction · 0.45

Calls 1

sanitizeMethod · 0.80

Tested by

no test coverage detected