summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-11-01 15:38:16 +0100
committerhut <hut@lavabit.com>2010-11-01 15:38:37 +0100
commitba72fe26af4dc8fc1580ac0ea39b831e4368c881 (patch)
treead217b1cf1aed16b008a5e13b6d3ad6a4ed25f66
parenta92f6409ab3a5d9bcf87639e5eedaf7c0c483eb6 (diff)
downloadranger-ba72fe26af4dc8fc1580ac0ea39b831e4368c881.tar.gz
fsobject.fsobject: fixed natural sort with python3
-rw-r--r--ranger/fsobject/fsobject.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index e513fc21..0e2b46f5 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -101,13 +101,13 @@ class FileSystemObject(FileManagerAware):
 
 	@lazy_property
 	def basename_natural(self):
-		return [int(c) if c.isdigit() else c or 0 \
-			for c in _extract_number_re.split(self.basename)]
+		return [c if i % 3 == 1 else (int(c) if c else 0) for i, c in \
+			enumerate(_extract_number_re.split(self.basename))]
 
 	@lazy_property
 	def basename_natural_lower(self):
-		return [int(c) if c.isdigit() else c or 0 \
-			for c in _extract_number_re.split(self.basename_lower)]
+		return [c if i % 3 == 1 else (int(c) if c else 0) for i, c in \
+			enumerate(_extract_number_re.split(self.basename_lower))]
 
 	def __str__(self):
 		"""returns a string containing the absolute path"""
'n154' href='#n154'>154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230