Exemplo n.º 1
0
 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,
     ]
Exemplo n.º 2
0
 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,
     ]
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)