コード例 #1
0
ファイル: stream.py プロジェクト: willtang/lyx2ebook
 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
ファイル: stream.py プロジェクト: willtang/lyx2ebook
 def from_string(self, text):
     '''
     Generate a stream from a string.
     '''
     return self(LineAwareSource(self.alphabet, StringIO(text), 
                                 sample('str: ', repr(text))))