Commit 88749462 by andreas.pelme

* urlquote() outputted URLs

 * distutils setup-script added



git-svn-id: https://django-compress.googlecode.com/svn/trunk@42 98d35234-f74b-0410-9e22-51d878bdf110
parent f33dcfc2
django-compress
---------------
Copyright (c) 2008 Andreas Pelme <andreas@pelme.se>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
jsmin.py (License-information from the file)
--------------------------------------------
This code is original from jsmin by Douglas Crockford, it was translated to
Python by Baruch Even. The original code had the following copyright and
license.
/* jsmin.c
2007-05-22
Copyright (c) 2002 Douglas Crockford (www.crockford.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
All documentation is currently only available at the Google Code wiki:
http://code.google.com/p/django-compress/
import os import os
from django.utils.http import urlquote
from django import template from django import template
from django.conf import settings as django_settings from django.conf import settings as django_settings
...@@ -15,7 +17,8 @@ def render_common(template_name, obj, filename): ...@@ -15,7 +17,8 @@ def render_common(template_name, obj, filename):
else: else:
context = {} context = {}
url = django_settings.MEDIA_URL + filename url = urlquote(django_settings.MEDIA_URL + filename)
if settings.COMPRESS and 'bump_filename' in obj and obj['bump_filename']: if settings.COMPRESS and 'bump_filename' in obj and obj['bump_filename']:
try: try:
url += '?%d' % os.stat(media_root(filename)).st_mtime url += '?%d' % os.stat(media_root(filename)).st_mtime
......
from distutils.core import setup
import os
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
# snippet from http://django-registration.googlecode.com/svn/trunk/setup.py
for dirpath, dirnames, filenames in os.walk('compress'):
# Ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'): del dirnames[i]
if '__init__.py' in filenames:
pkg = dirpath.replace(os.path.sep, '.')
if os.path.altsep:
pkg = pkg.replace(os.path.altsep, '.')
packages.append(pkg)
elif filenames:
prefix = dirpath[9:] # Strip "registration/" or "registration\"
for f in filenames:
data_files.append(os.path.join(prefix, f))
setup(
name='compress',
version='0.1-svn',
description='django-compress provides an automated system for compressing CSS and JavaScript files',
author='Andreas Pelme',
author_email='Andreas Pelme <andreas@pelme.se>',
url='http://code.google.com/p/django-compress/',
packages = packages,
package_data = {'compress': data_files,},
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities',
]
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment