Permalink
Browse files

* urlquote() outputted URLs

 * distutils setup-script added



git-svn-id: https://django-compress.googlecode.com/svn/trunk@42 98d35234-f74b-0410-9e22-51d878bdf110
  • Loading branch information...
1 parent f33dcfc commit 88749462a782e8d5288ede33543b0554cc3944ec andreas.pelme committed May 1, 2008
Showing with 104 additions and 1 deletion.
  1. +53 −0 LICENSE
  2. +3 −0 README
  3. +4 −1 compress/templatetags/compressed.py
  4. +44 −0 setup.py
View
@@ -0,0 +1,53 @@
+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.
+*/
View
@@ -0,0 +1,3 @@
+All documentation is currently only available at the Google Code wiki:
+
+http://code.google.com/p/django-compress/
@@ -1,5 +1,7 @@
import os
+from django.utils.http import urlquote
+
from django import template
from django.conf import settings as django_settings
@@ -15,7 +17,8 @@ def render_common(template_name, obj, filename):
else:
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']:
try:
url += '?%d' % os.stat(media_root(filename)).st_mtime
View
@@ -0,0 +1,44 @@
+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',
+ ]
+)

0 comments on commit 8874946

Please sign in to comment.