예제 #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))))