comparison genshi/filters/transform.py @ 854:0d9e87c6cf6e

More work on reducing the size of the diff produced by 2to3.
author cmlenz
date Tue, 10 Nov 2009 22:53:21 +0000
parents 4376010bb97e
children 24733a5854d9
comparison
equal deleted inserted replaced
853:4376010bb97e 854:0d9e87c6cf6e
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 # 2 #
3 # Copyright (C) 2007 Edgewall Software 3 # Copyright (C) 2007-2009 Edgewall Software
4 # All rights reserved. 4 # All rights reserved.
5 # 5 #
6 # This software is licensed as described in the file COPYING, which 6 # This software is licensed as described in the file COPYING, which
7 # you should have received as part of this distribution. The terms 7 # you should have received as part of this distribution. The terms
8 # are also available at http://genshi.edgewall.org/wiki/License. 8 # are also available at http://genshi.edgewall.org/wiki/License.
874 """Apply the transform filter to the marked stream. 874 """Apply the transform filter to the marked stream.
875 875
876 :param stream: the marked event stream to filter 876 :param stream: the marked event stream to filter
877 """ 877 """
878 for event in stream: 878 for event in stream:
879 print>>self.fileobj, self.prefix + str(event) 879 self.fileobj.write('%s%s\n' % (self.prefix, event))
880 yield event 880 yield event
881 881
882 882
883 class FilterTransformation(object): 883 class FilterTransformation(object):
884 """Apply a normal stream filter to the selection. The filter is called once 884 """Apply a normal stream filter to the selection. The filter is called once
Copyright (C) 2012-2017 Edgewall Software