diff options
| author | markotibold | 2011-04-27 14:28:48 +0200 |
|---|---|---|
| committer | markotibold | 2011-04-27 14:28:48 +0200 |
| commit | 31bfdbeb1a5911e4c313b6742dfb6cb70ee13a5c (patch) | |
| tree | b59f8a0e3b70d1041e7d647894c96bc7d006f68f /examples | |
| parent | a880bf460af4cd9135bc8cc85de9806f3f314e3c (diff) | |
| download | django-rest-framework-31bfdbeb1a5911e4c313b6742dfb6cb70ee13a5c.tar.bz2 | |
reverse on a a sorted list which was laerady reversed is rather pointless :)
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/pygments_api/views.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/pygments_api/views.py b/examples/pygments_api/views.py index 6fb9217a..377761b1 100644 --- a/examples/pygments_api/views.py +++ b/examples/pygments_api/views.py @@ -25,7 +25,7 @@ def list_dir_sorted_by_ctime(dir): """Return a list of files sorted by creation time""" filepaths = [os.path.join(dir, file) for file in os.listdir(dir) if not file.startswith('.')] return [item[0] for item in sorted([(path, os.path.getctime(path)) for path in filepaths], - key=operator.itemgetter(1), reverse=True)] + key=operator.itemgetter(1), reverse=False)] def remove_oldest_files(dir, max_files): """Remove the oldest files in a directory 'dir', leaving at most 'max_files' remaining. We use this to limit the number of resources in the sandbox.""" |
