MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _get_tab_bar_height

Method _get_tab_bar_height

lib/utils/tui.py:99–118  ·  view source on GitHub ↗

Calculate how many rows the tab bar uses

(self)

Source from the content-addressed store, hash-verified

97 self.stdscr.attroff(curses.color_pair(1) | curses.A_BOLD)
98
99 def _get_tab_bar_height(self):
100 """Calculate how many rows the tab bar uses"""
101 height, width = self.stdscr.getmaxyx()
102 y = 1
103 x = 0
104
105 for i, tab in enumerate(self.tabs):
106 tab_text = " %s " % tab['title']
107
108 # Check if tab exceeds width, wrap to next line
109 if x + len(tab_text) >= width:
110 y += 1
111 x = 0
112 # Stop if we've used too many lines
113 if y >= 3:
114 break
115
116 x += len(tab_text) + 1
117
118 return y
119
120 def _draw_tabs(self):
121 """Draw the tab bar"""

Callers 1

_draw_current_tabMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected