Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
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
OpenEdx
django-pipeline
Commits
edc4d502
Commit
edc4d502
authored
Jul 28, 2011
by
Kyle MacFarlane
Committed by
Timothée Peignier
Jul 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cleanup for all storages
Signed-off-by: Timothée Peignier <timothee.peignier@tryphon.org>
parent
9c3346f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
pipeline/versioning/__init__.py
+6
-2
No files found.
pipeline/versioning/__init__.py
View file @
edc4d502
...
@@ -47,14 +47,18 @@ class Versioning(object):
...
@@ -47,14 +47,18 @@ class Versioning(object):
if
not
(
settings
.
PIPELINE_VERSION
and
settings
.
PIPELINE_VERSION_REMOVE_OLD
):
if
not
(
settings
.
PIPELINE_VERSION
and
settings
.
PIPELINE_VERSION_REMOVE_OLD
):
return
# Nothing to delete here
return
# Nothing to delete here
path
=
os
.
path
.
dirname
(
filename
)
path
=
os
.
path
.
dirname
(
filename
)
filename
=
os
.
path
.
basename
(
filename
)
filename
=
settings
.
PIPELINE_VERSION_PLACEHOLDER
.
join
([
re
.
escape
(
part
)
for
part
in
filename
.
split
(
settings
.
PIPELINE_VERSION_PLACEHOLDER
)])
filename
=
settings
.
PIPELINE_VERSION_PLACEHOLDER
.
join
([
re
.
escape
(
part
)
for
part
in
filename
.
split
(
settings
.
PIPELINE_VERSION_PLACEHOLDER
)])
regex
=
re
.
compile
(
r'^
%
s$'
%
os
.
path
.
basename
(
self
.
output_filename
(
filename
,
r'([A-Za-z0-9]+)'
)
))
regex
=
re
.
compile
(
r'^
%
s$'
%
self
.
output_filename
(
filename
,
r'([A-Za-z0-9]+)'
))
if
storage
.
exists
(
path
)
:
try
:
for
f
in
storage
.
listdir
(
path
)[
1
]:
for
f
in
storage
.
listdir
(
path
)[
1
]:
if
regex
.
match
(
f
):
if
regex
.
match
(
f
):
if
self
.
verbose
:
if
self
.
verbose
:
print
"Removing outdated file
%
s"
%
f
print
"Removing outdated file
%
s"
%
f
storage
.
delete
(
os
.
path
.
join
(
path
,
f
))
storage
.
delete
(
os
.
path
.
join
(
path
,
f
))
except
EnvironmentError
:
# We can't use exists() first because some backends (S3) have no concept of directories.
pass
class
VersioningBase
(
object
):
class
VersioningBase
(
object
):
...
...
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