MCPcopy
hub / github.com/catherinedevlin/ipython-sql / _repr_html_

Method _repr_html_

src/sql/run.py:115–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

113 list.__init__(self, [])
114 self.pretty = None
115 def _repr_html_(self):
116 _cell_with_spaces_pattern = re.compile(r'(<td>)( {2,})')
117 if self.pretty:
118 result = self.pretty.get_html_string()
119 result = _cell_with_spaces_pattern.sub(_nonbreaking_spaces, result)
120 if self.config.displaylimit and len(self) > self.config.displaylimit:
121 result = '%s\n<span style="font-style:italic;text-align:center;">%d rows, truncated to displaylimit of %d</span>' % (
122 result, len(self), self.config.displaylimit)
123 return result
124 else:
125 return None
126 def __str__(self, *arg, **kwarg):
127 return str(self.pretty or '')
128 def __getitem__(self, key):

Callers 2

test_htmlFunction · 0.45
test_displaylimitFunction · 0.45

Calls

no outgoing calls

Tested by 2

test_htmlFunction · 0.36
test_displaylimitFunction · 0.36