Exemplo n.º 1
0
 def _split_lines(self, text, width):
     if text.startswith('R|'):
         raw_text = text[2:]
         if "<br>" in raw_text:
             return raw_text.split('<br>')
         return HelpFormatter._split_lines(self, raw_text, width)
         # this is the RawTextHelpFormatter._split_lines
     return HelpFormatter._split_lines(self, text, width)
Exemplo n.º 2
0
 def test_normal(self):
     formatter = shell.SmartFormatter(None)
     raw_string = 'This is a raw string that will be split over lines '\
         'because it will go into the HelpFormatter.  but This string '\
         'needs to be longer'\
         'than 80 chars to split on the lines'
     value = formatter._split_lines(raw_string, self.width)
     self.assertEqual(
         value, HelpFormatter._split_lines(formatter, raw_string,
                                           self.width))
Exemplo n.º 3
0
 def test_normal(self):
     formatter = shell.SmartFormatter(None)
     raw_string = 'This is a raw string that will be split over lines '\
         'because it will go into the HelpFormatter.  but This string '\
         'needs to be longer'\
         'than 80 chars to split on the lines'
     value = formatter._split_lines(raw_string, self.width)
     self.assertEqual(
         value, HelpFormatter._split_lines(formatter,
                                           raw_string,
                                           self.width))
Exemplo n.º 4
0
 def _split_lines(self, text, width):
     if text.startswith('R|'):
         return text[2:].splitlines()
     # this is the RawTextHelpFormatter._split_lines
     return HelpFormatter._split_lines(self, text, width)
Exemplo n.º 5
0
 def _split_lines(self, text, width):
     # this is the RawTextHelpFormatter._split_lines
     if text.startswith('R|'):
         return text[2:].splitlines()
     return HelpFormatter._split_lines(self, text, width)
Exemplo n.º 6
0
 def _split_lines(self, text, width):
     print(text)
     if text.startswith('CF|'):
         return text[3:].splitlines()
     return HelpFormatter._split_lines(self, text, width)
Exemplo n.º 7
0
 def _split_lines(self, text, width):
     print(text)
     if text.startswith('CF|'):
         return text[3:].splitlines()
     return HelpFormatter._split_lines(self, text, width)
Exemplo n.º 8
0
 def _split_lines(self, text, width):
     if text.startswith('raw|'):
         return text[4:].splitlines()
     return HelpFormatter._split_lines(self, text, width)