Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
31bfdbeb
Commit
31bfdbeb
authored
Apr 27, 2011
by
markotibold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reverse on a a sorted list which was laerady reversed is rather pointless :)
parent
a880bf46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
+1
-1
examples/pygments_api/views.py
+1
-1
No files found.
examples/pygments_api/views.py
View file @
31bfdbeb
...
@@ -25,7 +25,7 @@ def list_dir_sorted_by_ctime(dir):
...
@@ -25,7 +25,7 @@ def list_dir_sorted_by_ctime(dir):
"""Return a list of files sorted by creation time"""
"""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
(
'.'
)]
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
],
return
[
item
[
0
]
for
item
in
sorted
([(
path
,
os
.
path
.
getctime
(
path
))
for
path
in
filepaths
],
key
=
operator
.
itemgetter
(
1
),
reverse
=
Tru
e
)]
key
=
operator
.
itemgetter
(
1
),
reverse
=
Fals
e
)]
def
remove_oldest_files
(
dir
,
max_files
):
def
remove_oldest_files
(
dir
,
max_files
):
"""Remove the oldest files in a directory 'dir', leaving at most 'max_files' remaining.
"""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."""
We use this to limit the number of resources in the sandbox."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment