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_))
def from_string(self, text): ''' Generate a stream from a string. ''' return self( LineAwareSource(self.alphabet, StringIO(text), sample('str: ', repr(text))))
def from_string(self, text): ''' Generate a stream from a string. ''' return self(LineAwareSource(self.alphabet, StringIO(text), sample('str: ', repr(text))))