def sort (self):
# Not a strict lexical sort!
- sortable_files = map(os.path.split, self.files)
- sortable_files.sort()
+ sortable_files = sorted(map(os.path.split, self.files))
self.files = []
for sort_tuple in sortable_files:
self.files.append(os.path.join(*sort_tuple))
# from the parsed tuple -- so I just store the string here for
# use by __str__
self.vstring = vstring
- components = filter(lambda x: x and x != '.',
- self.component_re.split(vstring))
- for i in range(len(components)):
+ components = [x for x in self.component_re.split(vstring)
+ if x and x != '.']
+ for i, obj in enumerate(components):
try:
- components[i] = int(components[i])
+ components[i] = int(obj)
except ValueError:
pass