1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 """
23 To merge all input flows.
24
25 Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
26 GNU General Public License.
27 """
28
29 from etl.component import component
30 import sys
31
33 """
34 This is an ETL Component that merge all input flows into only one output flow.
35
36 Type : Data Component.
37 Computing Performance : Streamline.
38 Input Flows : 0-x.
39 * .* : The main data flow with input data.
40 Output Flows : 1.
41 * .* : Returns the main flow.
42 """
43
45 my_gen_list = []
46 for list_trans in self.input_get().values():
47 my_gen_list += list_trans
48 p = -1
49 while my_gen_list:
50 p = (p+1) % len(my_gen_list)
51 try:
52 data = my_gen_list[p].next()
53 yield data, 'main'
54 except StopIteration, e:
55 del my_gen_list[p]
56 p = 0
57
58 if __name__ == '__main__':
59
60
61
62
63
64 pass
65