def init_tooltips(self): """Store formatted tooltip texts from URL data.""" # Display warnings in result tooltip if self.url_data.warnings: text = u"\n".join(x[1] for x in self.url_data.warnings) result = strformat.wrap(text, 60) else: result = u"" self.tooltips = [ # Parent URL u"", # URL unicode(self.url_data.url), # Name self.url_data.name, # Result result, ]
def init_tooltips (self): """Store formatted tooltip texts from URL data.""" # Display warnings in result tooltip if self.url_data.warnings: text = u"\n".join(x[1] for x in self.url_data.warnings) result = strformat.wrap(text, 60) else: result = u"" self.tooltips = [ # Parent URL u"", # URL unicode(self.url_data.url), # Name self.url_data.name, # Result result, ]
def wrap (lines, width): """Format lines with given line-width.""" sep = os.linesep+os.linesep text = sep.join(lines) kwargs = dict(break_long_words=False, break_on_hyphens=False) return strformat.wrap(text, width, **kwargs)
def wrap(lines, width): """Format lines with given line-width.""" sep = os.linesep + os.linesep text = sep.join(lines) kwargs = dict(break_long_words=False, break_on_hyphens=False) return strformat.wrap(text, width, **kwargs)