Пример #1
0
 def from_lines(self, lines, source=None, join_=''.join):
     '''
     Generate a stream from a set of lines.
     '''
     if source is None:
         source = sample('lines: ', repr(lines))
     return self(LineAwareSource(self.alphabet, lines, source, join_))
Пример #2
0
 def from_lines(self, lines, source=None, join_=''.join):
     '''
     Generate a stream from a set of lines.
     '''
     if source is None:
         source = sample('lines: ', repr(lines))
     return self(LineAwareSource(self.alphabet, lines, source, join_))
Пример #3
0
 def from_string(self, text):
     '''
     Generate a stream from a string.
     '''
     return self(
         LineAwareSource(self.alphabet, StringIO(text),
                         sample('str: ', repr(text))))
Пример #4
0
 def from_string(self, text):
     '''
     Generate a stream from a string.
     '''
     return self(LineAwareSource(self.alphabet, StringIO(text), 
                                 sample('str: ', repr(text))))