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
f34a5dd0
Commit
f34a5dd0
authored
Mar 12, 2009
by
Andreas Pelme
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git://github.com/paltman/django-compress
parents
9a0fe623
bb57b2d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
AUTHORS
+1
-0
compress/utils.py
+10
-6
No files found.
AUTHORS
View file @
f34a5dd0
...
...
@@ -9,6 +9,7 @@ or just made django-compress more awesome.
* Alexander Pugachev <alexander.pugachev@gmail.com>
* Sander Smits <jhmsmits@gmail.com>
* Remco Wendt <remco@maykinmedia.nl>
* Patrick Altman <paltman@gmail.com>
The Python-version of jsmin (http://www.crockford.com/javascript/jsmin.html)
is included in django-compress. It was translated from to Python by Baruch
...
...
compress/utils.py
View file @
f34a5dd0
...
...
@@ -81,6 +81,9 @@ def max_mtime(files):
return
int
(
max
([
os
.
stat
(
media_root
(
f
))
.
st_mtime
for
f
in
files
]))
def
save_file
(
filename
,
contents
):
dirname
=
os
.
path
.
dirname
(
media_root
(
filename
))
if
not
os
.
path
.
exists
(
dirname
):
os
.
makedirs
(
dirname
)
fd
=
open
(
media_root
(
filename
),
'wb+'
)
fd
.
write
(
contents
)
fd
.
close
()
...
...
@@ -104,12 +107,13 @@ def get_version_from_file(path, filename):
def
remove_files
(
path
,
filename
,
verbosity
=
0
):
regex
=
re
.
compile
(
r'^
%
s$'
%
(
os
.
path
.
basename
(
get_output_filename
(
settings
.
COMPRESS_VERSION_PLACEHOLDER
.
join
([
re
.
escape
(
part
)
for
part
in
filename
.
split
(
settings
.
COMPRESS_VERSION_PLACEHOLDER
)]),
r'[A-Za-z0-9]+'
))))
for
f
in
os
.
listdir
(
path
):
if
regex
.
match
(
f
):
if
verbosity
>=
1
:
print
"Removing outdated file
%
s"
%
f
os
.
unlink
(
os
.
path
.
join
(
path
,
f
))
if
os
.
path
.
exists
(
path
):
for
f
in
os
.
listdir
(
path
):
if
regex
.
match
(
f
):
if
verbosity
>=
1
:
print
"Removing outdated file
%
s"
%
f
os
.
unlink
(
os
.
path
.
join
(
path
,
f
))
def
filter_common
(
obj
,
verbosity
,
filters
,
attr
,
separator
,
signal
):
output
=
concat
(
obj
[
'source_filenames'
],
separator
)
...
...
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