summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-21 01:48:12 +0100
committerhut <hut@lavabit.com>2010-01-21 01:48:12 +0100
commitb953eb51ab4f70f35e643a6b345a79b98d9cea98 (patch)
tree3973a9afdfc65b0389498c85ec9f4e67dbc8e936 /ranger
parente99d68577df610f885316c0d937d98bf8c0ede3c (diff)
downloadranger-b953eb51ab4f70f35e643a6b345a79b98d9cea98.tar.gz
ext/flatten: flatten deques too.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/ext/flatten.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ranger/ext/flatten.py b/ranger/ext/flatten.py
index 19342efe..55d3e82f 100644
--- a/ranger/ext/flatten.py
+++ b/ranger/ext/flatten.py
@@ -12,15 +12,17 @@
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
+from collections import deque
+
 def flatten(lst):
 	"""
 	Flatten an iterable.
 
-	All contained tuples, lists and sets are replaced by their
+	All contained tuples, lists, deques and sets are replaced by their
 	elements and flattened as well.
 	"""
 	for elem in lst:
-		if isinstance(elem, (tuple, list, set)):
+		if isinstance(elem, (tuple, list, set, deque)):
 			for subelem in flatten(elem):
 				yield subelem
 		else:
anti/profani-tty/blame/functionaltests/test_ping.c?id=d4784db7e1cb4d6bb85cbd8a0caddafb7a7afdec'>^
b8c94376 ^
7f98e013 ^
f17afcf5 ^

a522d022 ^
f17afcf5 ^


b8c94376 ^
7f98e013 ^
f17afcf5 ^

a522d022 ^
f17afcf5 ^


f189dbc6 ^
6511d61b ^



970ab94e ^
6511d61b ^










f189dbc6 ^
f17afcf5 ^
a48b9fce ^
f17afcf5 ^

7f98e013 ^

f17afcf5 ^



7f98e013 ^
f17afcf5 ^

f189dbc6 ^




a28f0d9e ^
f189dbc6 ^
















a28f0d9e ^
f189dbc6 ^







a28f0d9e ^
f189dbc6 ^




















a28f0d9e ^
f189dbc6 ^















a28f0d9e ^
f189dbc6 ^







a28f0d9e ^
f189dbc6 ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170