MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _fetch_discovered_data

Method _fetch_discovered_data

display.py:1082–1120  ·  view source on GitHub ↗

Fetch real credentials, loot, and attack data.

(self)

Source from the content-addressed store, hash-verified

1080 font_title = self._fit_font('Viking.TTF', self.shared_data.font_viking,
1081 title, w - int(8 * sx))
1082 # Outer border: kept on the wider e-paper panels (where it sits clear of
1083 # the edge), dropped on the narrow LCD HAT where the ST7735S's few-pixel
1084 # visible-area offset makes an edge-hugging line look ragged.
1085 if w >= 150:
1086 draw.rectangle((1, 1, w - 1, h - 1), outline=self._wd_c(draw, 'frame'))
1087 draw.text((int(4 * sx), int(4 * sy)), title, font=font_title, fill=self._wd_c(draw, 'title'))
1088 draw.line((1, int(22 * sy), w - 1, int(22 * sy)), fill=self._wd_c(draw, 'frame'))
1089 draw.line((1, h - int(18 * sy), w - 1, h - int(18 * sy)), fill=self._wd_c(draw, 'frame'))
1090 # Trim the footer hint so it never overflows a narrow panel (e.g. the
1091 # 128px LCD HAT); on wider e-paper it already fits, so this is a no-op.
1092 avail = w - int(8 * sx)
1093 while hint and font.getlength(hint) > avail:
1094 hint = hint[:-1]
1095 draw.text((int(4 * sx), h - int(16 * sy)), hint, font=font, fill=self._wd_c(draw, 'dim'))
1096
1097 def _draw_stat_rows(self, draw, y, stats):
1098 """Draw key-value stat rows. Returns final y position."""
1099 w = getattr(self, 'render_w', self.shared_data.width)
1100 h = getattr(self, 'render_h', self.shared_data.height)
1101 sx = getattr(self, 'render_sx', self.scale_factor_x)
1102 sy = getattr(self, 'render_sy', self.scale_factor_y)
1103 font = self.shared_data.font_arial9
1104 # Tighten row spacing on a short panel so tall pages (up to ~7 rows) fit
1105 # a 128px square without spilling into the footer band.
1106 line_h = int(12 * sy) if h < 150 else int(14 * sy)
1107 pad_x = int(6 * sx)
1108 for label, value in stats:
1109 val_str = str(value)[:22]
1110 draw.text((pad_x, y), label, font=font, fill=self._wd_c(draw, 'dim'))
1111 draw.text((w - pad_x - font.getlength(val_str), y), val_str, font=font, fill=self._wd_c(draw, 'ink'))
1112 y += line_h
1113 return y
1114
1115 def _draw_adapter_rows(self, draw, y, rows):
1116 """Draw verbose per-adapter rows as one left-aligned line each.
1117
1118 Unlike _draw_stat_rows the value is rendered next to the label with a
1119 small dynamic gap (no right-align, no 22-char truncation), so longer
1120 values like '19 Networks, M RSSI: -63 dBm [2.4]' survive intact and
1121 the value gets every available pixel of row width. If the combined
1122 string still overflows, it&#x27;s trimmed character-by-character until it
1123 fits.

Callers

nothing calls this directly

Calls 2

_count_cred_fileMethod · 0.95
valuesMethod · 0.45

Tested by

no test coverage detected