diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 4120439..0000000 --- a/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -RUN -RUN_* -*.sock -*.pid -*.pyc -*.swp -*.swo -*_secret.py -secret.py -.DS_Store -#settings.py diff --git a/README.md b/README.md index 66ec61b..f0c9e4d 100644 --- a/README.md +++ b/README.md @@ -3,26 +3,10 @@ Getting started Make sure you have the following packages installed: -* Django 1.4 +* Django 1.11 * mongo-python-driver -Make a copy the included default project settings: - - cp mongoadmin_project/settings.py.dist mongoadmin_project/settings.py - -Create a database for Django (by default, it is a MySQL database called `mongoadmin`, but you can change it in `DATABASES` in the settings). This database is required to store sessions or to save database connection details. - -Fill in `SECRET_KEY` (can be any random string) in the settings.py file that you created. - -Create SQL database tables: - - python manage.py syncdb - -Run the server: - - python manage.py runserver - -Go to http://127.0.0.1:8000/ and connect to your Mongo database. +pip install -r requirements.txt License ======= @@ -33,4 +17,4 @@ Ideas for further development * Connecting: Store favorites, support for SSH tunnels * Collection view: Ability to store filters / views -* Support for indexes, etc. +* Support for indexes, etc. \ No newline at end of file diff --git a/compressor b/compressor deleted file mode 120000 index ff5df5f..0000000 --- a/compressor +++ /dev/null @@ -1 +0,0 @@ -django_compressor-0.9.2/compressor \ No newline at end of file diff --git a/django_compressor-0.9.2/.gitignore b/django_compressor-0.9.2/.gitignore deleted file mode 100755 index b01b117..0000000 --- a/django_compressor-0.9.2/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -build -compressor/tests/media/CACHE -compressor/tests/media/custom -compressor/tests/media/js/066cd253eada.js -dist -MANIFEST -*.pyc -*.egg-info -.tox/ -*.egg -docs/_build/ -.coverage -htmlcov -.sass-cache \ No newline at end of file diff --git a/django_compressor-0.9.2/AUTHORS b/django_compressor-0.9.2/AUTHORS deleted file mode 100755 index 89b024f..0000000 --- a/django_compressor-0.9.2/AUTHORS +++ /dev/null @@ -1,36 +0,0 @@ -Christian Metts -Carl Meyer -Jannis Leidel - -Django Compressor's filters started life as the filters from Andreas Pelme's -django-compress. - -Contributors: - -Aaron Godfrey -Atamert Ölçgen -Ben Spaulding -Benjamin Wohlwend -Brad Whittington -Chris Adams -David Ziegler -Eugene Mirotin -Fenn Bailey -Gert Van Gool -Harro van der Klauw -Jaap Roes -James Roe -Jason Davies -Jeremy Dunck -Justin Lilly -Maciek Szczesniak -Mathieu Pillard -Mehmet S. Catalbas -Mike Yumatov -Petar Radosevic -Philipp Bosch -Philipp Wollermann -Selwin Ong -Shabda Raaj -Thom Linton -Ulrich Petri diff --git a/django_compressor-0.9.2/LICENSE b/django_compressor-0.9.2/LICENSE deleted file mode 100755 index dfe6a03..0000000 --- a/django_compressor-0.9.2/LICENSE +++ /dev/null @@ -1,128 +0,0 @@ -django_compressor ------------------ -Copyright (c) 2009-2011 django_compressor authors (see AUTHORS file) - -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. - - -django_compressor contains code from Andreas Pelme's django-compress --------------------------------------------------------------------- -Copyright (c) 2008 Andreas Pelme - -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. - - -rjsmin.py (License-information from the file) ---------------------------------------------- -Copyright 2006, 2007, 2008, 2009, 2010, 2011 -André Malo or his licensors, as applicable - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - -utils.cache.cached_property extracted from Celery -------------------------------------------- -Copyright (c) 2009-2011, Ask Solem and contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -Neither the name of Ask Solem nor the names of its contributors may be used -to endorse or promote products derived from this software without specific -prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -utils.FormattableString ------------------------ -Copyright (c) 2010 by Florent Xicluna. - -Some rights reserved. - -Redistribution and use in source and binary forms of the software as well -as documentation, with or without modification, are permitted provided -that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - -* The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT -NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. diff --git a/django_compressor-0.9.2/MANIFEST.in b/django_compressor-0.9.2/MANIFEST.in deleted file mode 100755 index 403d1c6..0000000 --- a/django_compressor-0.9.2/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include AUTHORS -include README.rst -include LICENSE -recursive-include compressor/templates/compressor *.html -recursive-include compressor/tests/media *.js *.css *.png diff --git a/django_compressor-0.9.2/README.rst b/django_compressor-0.9.2/README.rst deleted file mode 100755 index fb8b9f6..0000000 --- a/django_compressor-0.9.2/README.rst +++ /dev/null @@ -1,66 +0,0 @@ -Django Compressor -================= - -Django Compressor combines and compresses linked and inline Javascript -or CSS in a Django templates into cacheable static files by using the -``compress`` template tag. - -HTML in between ``{% compress js/css %}`` and ``{% endcompress %}`` is -parsed and searched for CSS or JS. These styles and scripts are subsequently -processed with optional, configurable compilers and filters. - -The default filter for CSS rewrites paths to static files to be absolute -and adds a cache busting timestamp. For Javascript the default filter -compresses it using ``jsmin``. - -As the final result the template tag outputs a `` \ No newline at end of file diff --git a/django_compressor-0.9.2/compressor/templates/compressor/js_inline.html b/django_compressor-0.9.2/compressor/templates/compressor/js_inline.html deleted file mode 100755 index 586bd93..0000000 --- a/django_compressor-0.9.2/compressor/templates/compressor/js_inline.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/django_compressor-0.9.2/compressor/templatetags/__init__.py b/django_compressor-0.9.2/compressor/templatetags/__init__.py deleted file mode 100755 index e69de29..0000000 diff --git a/django_compressor-0.9.2/compressor/templatetags/compress.py b/django_compressor-0.9.2/compressor/templatetags/compress.py deleted file mode 100755 index 6ae3877..0000000 --- a/django_compressor-0.9.2/compressor/templatetags/compress.py +++ /dev/null @@ -1,149 +0,0 @@ -from django import template -from django.core.exceptions import ImproperlyConfigured - -from compressor.cache import (cache, cache_get, cache_set, - get_offline_cachekey, get_templatetag_cachekey) -from compressor.conf import settings -from compressor.utils import get_class - -register = template.Library() - -OUTPUT_FILE = 'file' -OUTPUT_INLINE = 'inline' -OUTPUT_MODES = (OUTPUT_FILE, OUTPUT_INLINE) -COMPRESSORS = { - "css": settings.COMPRESS_CSS_COMPRESSOR, - "js": settings.COMPRESS_JS_COMPRESSOR, -} - -class CompressorNode(template.Node): - - def __init__(self, nodelist, kind=None, mode=OUTPUT_FILE): - self.nodelist = nodelist - self.kind = kind - self.mode = mode - self.compressor_cls = get_class( - COMPRESSORS.get(self.kind), exception=ImproperlyConfigured) - - def debug_mode(self, context): - if settings.COMPRESS_DEBUG_TOGGLE: - # Only check for the debug parameter - # if a RequestContext was used - request = context.get('request', None) - if request is not None: - return settings.COMPRESS_DEBUG_TOGGLE in request.GET - - def render_offline(self, forced): - """ - If enabled and in offline mode, and not forced or in debug mode - check the offline cache and return the result if given - """ - if (settings.COMPRESS_ENABLED and - settings.COMPRESS_OFFLINE) and not forced: - return cache.get(get_offline_cachekey(self.nodelist)) - - def render_cached(self, compressor, forced): - """ - If enabled checks the cache for the given compressor's cache key - and return a tuple of cache key and output - """ - if settings.COMPRESS_ENABLED and not forced: - cache_key = get_templatetag_cachekey( - compressor, self.mode, self.kind) - cache_content = cache_get(cache_key) - return cache_key, cache_content - return None, None - - def render(self, context, forced=False): - # 1. Check if in debug mode - if self.debug_mode(context): - return self.nodelist.render(context) - - # 2. Try offline cache. - cached_offline = self.render_offline(forced) - if cached_offline: - return cached_offline - - # 3. Prepare the actual compressor and check cache - compressor = self.compressor_cls(self.nodelist.render(context)) - cache_key, cache_content = self.render_cached(compressor, forced) - if cache_content is not None: - return cache_content - - # 4. call compressor output method and handle exceptions - rendered_output = compressor.output(self.mode, forced=forced) - try: - rendered_output = compressor.output(self.mode, forced=forced) - if cache_key: - cache_set(cache_key, rendered_output) - return rendered_output - except Exception, e: - if settings.DEBUG or forced: - raise e - - # 5. Or don't do anything in production - return self.nodelist.render(context) - - -@register.tag -def compress(parser, token): - """ - Compresses linked and inline javascript or CSS into a single cached file. - - Syntax:: - - {% compress %} - - {% endcompress %} - - Examples:: - - {% compress css %} - - - - {% endcompress %} - - Which would be rendered something like:: - - - - or:: - - {% compress js %} - - - {% endcompress %} - - Which would be rendered something like:: - - - - Linked files must be on your COMPRESS_URL (which defaults to MEDIA_URL). - If DEBUG is true off-site files will throw exceptions. If DEBUG is false - they will be silently stripped. - """ - - nodelist = parser.parse(('endcompress',)) - parser.delete_first_token() - - args = token.split_contents() - - if not len(args) in (2, 3): - raise template.TemplateSyntaxError( - "%r tag requires either one or two arguments." % args[0]) - - kind = args[1] - if not kind in COMPRESSORS.keys(): - raise template.TemplateSyntaxError( - "%r's argument must be 'js' or 'css'." % args[0]) - - if len(args) == 3: - mode = args[2] - if not mode in OUTPUT_MODES: - raise template.TemplateSyntaxError( - "%r's second argument must be '%s' or '%s'." % - (args[0], OUTPUT_FILE, OUTPUT_INLINE)) - else: - mode = OUTPUT_FILE - return CompressorNode(nodelist, kind, mode) diff --git a/django_compressor-0.9.2/compressor/tests/__init__.py b/django_compressor-0.9.2/compressor/tests/__init__.py deleted file mode 100755 index e69de29..0000000 diff --git a/django_compressor-0.9.2/compressor/tests/media/config.rb b/django_compressor-0.9.2/compressor/tests/media/config.rb deleted file mode 100755 index 148088b..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/config.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Require any additional compass plugins here. - -# Set this to the root of your project when deployed: -http_path = "/" -css_dir = "stylesheets" -sass_dir = "sass" -images_dir = "images" -javascripts_dir = "javascripts" - -# You can select your preferred output style here (can be overridden via the command line): -# output_style = :expanded or :nested or :compact or :compressed - -# To enable relative paths to assets via compass helper functions. Uncomment: -# relative_assets = true - -# To disable debugging comments that display the original location of your selectors. Uncomment: -# line_comments = false - - -# If you prefer the indented syntax, you might want to regenerate this -# project again passing --syntax sass, or you can uncomment this: -# preferred_syntax = :sass -# and then run: -# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass diff --git a/django_compressor-0.9.2/compressor/tests/media/css/datauri.css b/django_compressor-0.9.2/compressor/tests/media/css/datauri.css deleted file mode 100755 index 6d45b40..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/css/datauri.css +++ /dev/null @@ -1,3 +0,0 @@ -.add { background-image: url("../img/add.png"); } -.python { background-image: url("../img/python.png"); } -.datauri { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0 vr4MkhoXe0rZigAAAABJRU5ErkJggg=="); } diff --git a/django_compressor-0.9.2/compressor/tests/media/css/nonasc.css b/django_compressor-0.9.2/compressor/tests/media/css/nonasc.css deleted file mode 100755 index 43159ab..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/css/nonasc.css +++ /dev/null @@ -1 +0,0 @@ -.byline:before { content: " — "; } \ No newline at end of file diff --git a/django_compressor-0.9.2/compressor/tests/media/css/one.css b/django_compressor-0.9.2/compressor/tests/media/css/one.css deleted file mode 100755 index 769b83f..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/css/one.css +++ /dev/null @@ -1 +0,0 @@ -body { background:#990; } \ No newline at end of file diff --git a/django_compressor-0.9.2/compressor/tests/media/css/two.css b/django_compressor-0.9.2/compressor/tests/media/css/two.css deleted file mode 100755 index b73f594..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/css/two.css +++ /dev/null @@ -1 +0,0 @@ -body { color:#fff; } \ No newline at end of file diff --git a/django_compressor-0.9.2/compressor/tests/media/css/url/2/url2.css b/django_compressor-0.9.2/compressor/tests/media/css/url/2/url2.css deleted file mode 100755 index 1114622..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/css/url/2/url2.css +++ /dev/null @@ -1,4 +0,0 @@ -p { background: url('../../../images/test.png'); } -p { background: url(../../../images/test.png); } -p { background: url( ../../../images/test.png ); } -p { background: url( '../../../images/test.png' ); } diff --git a/django_compressor-0.9.2/compressor/tests/media/css/url/nonasc.css b/django_compressor-0.9.2/compressor/tests/media/css/url/nonasc.css deleted file mode 100755 index 2afa456..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/css/url/nonasc.css +++ /dev/null @@ -1,2 +0,0 @@ -p { background: url( '../../images/test.png' ); } -.byline:before { content: " — "; } \ No newline at end of file diff --git a/django_compressor-0.9.2/compressor/tests/media/css/url/test.css b/django_compressor-0.9.2/compressor/tests/media/css/url/test.css deleted file mode 100755 index 0f6edf8..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/css/url/test.css +++ /dev/null @@ -1 +0,0 @@ -p { background: url('/media/images/image.gif') } \ No newline at end of file diff --git a/django_compressor-0.9.2/compressor/tests/media/css/url/url1.css b/django_compressor-0.9.2/compressor/tests/media/css/url/url1.css deleted file mode 100755 index d202a47..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/css/url/url1.css +++ /dev/null @@ -1,4 +0,0 @@ -p { background: url('../../images/test.png'); } -p { background: url(../../images/test.png); } -p { background: url( ../../images/test.png ); } -p { background: url( '../../images/test.png' ); } diff --git a/django_compressor-0.9.2/compressor/tests/media/img/add.png b/django_compressor-0.9.2/compressor/tests/media/img/add.png deleted file mode 100755 index 6332fef..0000000 Binary files a/django_compressor-0.9.2/compressor/tests/media/img/add.png and /dev/null differ diff --git a/django_compressor-0.9.2/compressor/tests/media/img/python.png b/django_compressor-0.9.2/compressor/tests/media/img/python.png deleted file mode 100755 index 738f6ed..0000000 Binary files a/django_compressor-0.9.2/compressor/tests/media/img/python.png and /dev/null differ diff --git a/django_compressor-0.9.2/compressor/tests/media/js/nonasc-latin1.js b/django_compressor-0.9.2/compressor/tests/media/js/nonasc-latin1.js deleted file mode 100755 index 109aa20..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/js/nonasc-latin1.js +++ /dev/null @@ -1 +0,0 @@ -var test_value = "berstrng"; diff --git a/django_compressor-0.9.2/compressor/tests/media/js/nonasc.js b/django_compressor-0.9.2/compressor/tests/media/js/nonasc.js deleted file mode 100755 index 838a628..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/js/nonasc.js +++ /dev/null @@ -1 +0,0 @@ -var test_value = "—"; diff --git a/django_compressor-0.9.2/compressor/tests/media/js/one.js b/django_compressor-0.9.2/compressor/tests/media/js/one.js deleted file mode 100755 index b7d2a00..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/js/one.js +++ /dev/null @@ -1 +0,0 @@ -obj = {}; \ No newline at end of file diff --git a/django_compressor-0.9.2/compressor/tests/media/sass/ie.scss b/django_compressor-0.9.2/compressor/tests/media/sass/ie.scss deleted file mode 100755 index 5cd5b6c..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/sass/ie.scss +++ /dev/null @@ -1,5 +0,0 @@ -/* Welcome to Compass. Use this file to write IE specific override styles. - * Import this file using the following HTML or equivalent: - * */ diff --git a/django_compressor-0.9.2/compressor/tests/media/sass/print.scss b/django_compressor-0.9.2/compressor/tests/media/sass/print.scss deleted file mode 100755 index b0e9e45..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/sass/print.scss +++ /dev/null @@ -1,3 +0,0 @@ -/* Welcome to Compass. Use this file to define print styles. - * Import this file using the following HTML or equivalent: - * */ diff --git a/django_compressor-0.9.2/compressor/tests/media/sass/screen.scss b/django_compressor-0.9.2/compressor/tests/media/sass/screen.scss deleted file mode 100755 index 81de847..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/sass/screen.scss +++ /dev/null @@ -1,6 +0,0 @@ -/* Welcome to Compass. - * In this file you should write your main styles. (or centralize your imports) - * Import this file using the following HTML or equivalent: - * */ - -@import "compass/reset"; diff --git a/django_compressor-0.9.2/compressor/tests/media/stylesheets/ie.css b/django_compressor-0.9.2/compressor/tests/media/stylesheets/ie.css deleted file mode 100755 index 5cd5b6c..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/stylesheets/ie.css +++ /dev/null @@ -1,5 +0,0 @@ -/* Welcome to Compass. Use this file to write IE specific override styles. - * Import this file using the following HTML or equivalent: - * */ diff --git a/django_compressor-0.9.2/compressor/tests/media/stylesheets/print.css b/django_compressor-0.9.2/compressor/tests/media/stylesheets/print.css deleted file mode 100755 index b0e9e45..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/stylesheets/print.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Welcome to Compass. Use this file to define print styles. - * Import this file using the following HTML or equivalent: - * */ diff --git a/django_compressor-0.9.2/compressor/tests/media/stylesheets/screen.css b/django_compressor-0.9.2/compressor/tests/media/stylesheets/screen.css deleted file mode 100755 index 669a832..0000000 --- a/django_compressor-0.9.2/compressor/tests/media/stylesheets/screen.css +++ /dev/null @@ -1,69 +0,0 @@ -/* Welcome to Compass. - * In this file you should write your main styles. (or centralize your imports) - * Import this file using the following HTML or equivalent: - * */ -/* line 17, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} - -/* line 20, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -body { - line-height: 1; -} - -/* line 22, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -ol, ul { - list-style: none; -} - -/* line 24, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -table { - border-collapse: collapse; - border-spacing: 0; -} - -/* line 26, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -caption, th, td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} - -/* line 28, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -q, blockquote { - quotes: none; -} -/* line 101, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -q:before, q:after, blockquote:before, blockquote:after { - content: ""; - content: none; -} - -/* line 30, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -a img { - border: none; -} - -/* line 115, ../../../../../usr/local/Cellar/gems/1.8/gems/compass-0.11.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} diff --git a/django_compressor-0.9.2/compressor/tests/models.py b/django_compressor-0.9.2/compressor/tests/models.py deleted file mode 100755 index e69de29..0000000 diff --git a/django_compressor-0.9.2/compressor/tests/precompiler.py b/django_compressor-0.9.2/compressor/tests/precompiler.py deleted file mode 100755 index e62a4b4..0000000 --- a/django_compressor-0.9.2/compressor/tests/precompiler.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -from __future__ import with_statement -import optparse -import sys - -def main(): - p = optparse.OptionParser() - p.add_option('-f', '--file', action="store", - type="string", dest="filename", - help="File to read from, defaults to stdin", default=None) - p.add_option('-o', '--output', action="store", - type="string", dest="outfile", - help="File to write to, defaults to stdout", default=None) - - options, arguments = p.parse_args() - - if options.filename: - f = open(options.filename) - content = f.read() - f.close() - else: - content = sys.stdin.read() - - content = content.replace('background:', 'color:') - - if options.outfile: - with open(options.outfile, 'w') as f: - f.write(content) - else: - print content - - -if __name__ == '__main__': - main() diff --git a/django_compressor-0.9.2/compressor/tests/runtests.py b/django_compressor-0.9.2/compressor/tests/runtests.py deleted file mode 100755 index 9752ec6..0000000 --- a/django_compressor-0.9.2/compressor/tests/runtests.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -import os -import sys -import coverage -from os.path import join - -from django.conf import settings - -TEST_DIR = os.path.dirname(os.path.abspath(__file__)) - -if not settings.configured: - settings.configure( - COMPRESS_CACHE_BACKEND = 'dummy://', - DATABASE_ENGINE='sqlite3', - INSTALLED_APPS=[ - 'compressor', - 'compressor.tests', - ], - MEDIA_URL = '/media/', - MEDIA_ROOT = os.path.join(TEST_DIR, 'media'), - TEMPLATE_DIRS = ( - os.path.join(TEST_DIR, 'templates'), - ), - TEST_DIR = TEST_DIR, - ) - -from django.test.simple import run_tests - - -def runtests(*test_args): - if not test_args: - test_args = ['tests'] - parent_dir = os.path.join(TEST_DIR, "..", "..") - sys.path.insert(0, parent_dir) - cov = coverage.coverage(branch=True, - include=[ - os.path.join(parent_dir, 'compressor', '*.py') - ], - omit=[ - join(parent_dir, 'compressor', 'tests', '*.py'), - join(parent_dir, 'compressor', 'utils', 'stringformat.py'), - join(parent_dir, 'compressor', 'filters', 'jsmin', 'rjsmin.py'), - join(parent_dir, 'compressor', 'filters', 'cssmin', 'cssmin.py'), - ]) - cov.load() - cov.start() - failures = run_tests(test_args, verbosity=1, interactive=True) - cov.stop() - cov.save() - sys.exit(failures) - - -if __name__ == '__main__': - runtests(*sys.argv[1:]) diff --git a/django_compressor-0.9.2/compressor/tests/templates/test_compressor_offline.html b/django_compressor-0.9.2/compressor/tests/templates/test_compressor_offline.html deleted file mode 100755 index eac0455..0000000 --- a/django_compressor-0.9.2/compressor/tests/templates/test_compressor_offline.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load compress %} -{% compress css%} - -{% endcompress %} - -{% compress js%} - -{% endcompress %} diff --git a/django_compressor-0.9.2/compressor/tests/tests.py b/django_compressor-0.9.2/compressor/tests/tests.py deleted file mode 100755 index 58d223c..0000000 --- a/django_compressor-0.9.2/compressor/tests/tests.py +++ /dev/null @@ -1,582 +0,0 @@ -from __future__ import with_statement -import os -import re -import sys -from unittest2 import skipIf - -from BeautifulSoup import BeautifulSoup - -try: - import lxml -except ImportError: - lxml = None - -try: - import html5lib -except ImportError: - html5lib = None - -try: - from BeautifulSoup import BeautifulSoup -except ImportError: - BeautifulSoup = None - -from django.core.cache.backends import dummy -from django.core.files.storage import get_storage_class -from django.template import Template, Context, TemplateSyntaxError -from django.test import TestCase - -from compressor import base -from compressor.base import SOURCE_HUNK, SOURCE_FILE -from compressor.cache import get_hashed_mtime, get_hexdigest -from compressor.conf import settings -from compressor.css import CssCompressor -from compressor.js import JsCompressor -from compressor.management.commands.compress import Command as CompressCommand -from compressor.utils import find_command -from compressor.filters.base import CompilerFilter - - -class CompressorTestCase(TestCase): - - def setUp(self): - self.maxDiff = None - settings.COMPRESS_ENABLED = True - settings.COMPRESS_PRECOMPILERS = {} - settings.COMPRESS_DEBUG_TOGGLE = 'nocompress' - self.css = """ - - - - """ - self.css_node = CssCompressor(self.css) - - self.js = """ - - - """ - self.js_node = JsCompressor(self.js) - - def test_css_split(self): - out = [ - (SOURCE_FILE, os.path.join(settings.COMPRESS_ROOT, u'css/one.css'), u'css/one.css', u''), - (SOURCE_HUNK, u'p { border:5px solid green;}', None, u''), - (SOURCE_FILE, os.path.join(settings.COMPRESS_ROOT, u'css/two.css'), u'css/two.css', u''), - ] - split = self.css_node.split_contents() - split = [(x[0], x[1], x[2], self.css_node.parser.elem_str(x[3])) for x in split] - self.assertEqual(out, split) - - def test_css_hunks(self): - out = ['body { background:#990; }', u'p { border:5px solid green;}', 'body { color:#fff; }'] - self.assertEqual(out, list(self.css_node.hunks)) - - def test_css_output(self): - out = u'body { background:#990; }\np { border:5px solid green;}\nbody { color:#fff; }' - self.assertEqual(out, self.css_node.combined) - - def test_css_mtimes(self): - is_date = re.compile(r'^\d{10}[\.\d]+$') - for date in self.css_node.mtimes: - self.assertTrue(is_date.match(str(float(date))), - "mtimes is returning something that doesn't look like a date: %s" % date) - - def test_css_return_if_off(self): - settings.COMPRESS_ENABLED = False - self.assertEqual(self.css, self.css_node.output()) - - def test_cachekey(self): - is_cachekey = re.compile(r'\w{12}') - self.assertTrue(is_cachekey.match(self.css_node.cachekey), - "cachekey is returning something that doesn't look like r'\w{12}'") - - def test_css_hash(self): - self.assertEqual('c618e6846d04', get_hexdigest(self.css, 12)) - - def test_css_return_if_on(self): - output = u'' - self.assertEqual(output, self.css_node.output().strip()) - - def test_js_split(self): - out = [(SOURCE_FILE, os.path.join(settings.COMPRESS_ROOT, u'js/one.js'), u'js/one.js', ''), - (SOURCE_HUNK, u'obj.value = "value";', None, '') - ] - split = self.js_node.split_contents() - split = [(x[0], x[1], x[2], self.js_node.parser.elem_str(x[3])) for x in split] - self.assertEqual(out, split) - - def test_js_hunks(self): - out = ['obj = {};', u'obj.value = "value";'] - self.assertEqual(out, list(self.js_node.hunks)) - - def test_js_concat(self): - out = u'obj = {};\nobj.value = "value";' - self.assertEqual(out, self.js_node.concat) - - def test_js_output(self): - out = u'obj={};obj.value="value";' - self.assertEqual(out, self.js_node.combined) - - def test_js_return_if_off(self): - try: - enabled = settings.COMPRESS_ENABLED - precompilers = settings.COMPRESS_PRECOMPILERS - settings.COMPRESS_ENABLED = False - settings.COMPRESS_PRECOMPILERS = {} - self.assertEqual(self.js, self.js_node.output()) - finally: - settings.COMPRESS_ENABLED = enabled - settings.COMPRESS_PRECOMPILERS = precompilers - - def test_js_return_if_on(self): - output = u'' - self.assertEqual(output, self.js_node.output()) - - def test_custom_output_dir(self): - try: - old_output_dir = settings.COMPRESS_OUTPUT_DIR - settings.COMPRESS_OUTPUT_DIR = 'custom' - output = u'' - self.assertEqual(output, JsCompressor(self.js).output()) - settings.COMPRESS_OUTPUT_DIR = '' - output = u'' - self.assertEqual(output, JsCompressor(self.js).output()) - settings.COMPRESS_OUTPUT_DIR = '/custom/nested/' - output = u'' - self.assertEqual(output, JsCompressor(self.js).output()) - finally: - settings.COMPRESS_OUTPUT_DIR = old_output_dir - - -class ParserTestCase(object): - - def setUp(self): - self.old_parser = settings.COMPRESS_PARSER - settings.COMPRESS_PARSER = self.parser_cls - super(ParserTestCase, self).setUp() - - def tearDown(self): - settings.COMPRESS_PARSER = self.old_parser - - -class LxmlParserTests(ParserTestCase, CompressorTestCase): - parser_cls = 'compressor.parser.LxmlParser' -LxmlParserTests = skipIf(lxml is None, 'lxml not found')(LxmlParserTests) - - -class Html5LibParserTests(ParserTestCase, CompressorTestCase): - parser_cls = 'compressor.parser.Html5LibParser' - - def test_css_split(self): - out = [ - (SOURCE_FILE, os.path.join(settings.COMPRESS_ROOT, u'css/one.css'), u'css/one.css', u''), - (SOURCE_HUNK, u'p { border:5px solid green;}', None, u''), - (SOURCE_FILE, os.path.join(settings.COMPRESS_ROOT, u'css/two.css'), u'css/two.css', u''), - ] - split = self.css_node.split_contents() - split = [(x[0], x[1], x[2], self.css_node.parser.elem_str(x[3])) for x in split] - self.assertEqual(out, split) - - def test_js_split(self): - out = [(SOURCE_FILE, os.path.join(settings.COMPRESS_ROOT, u'js/one.js'), u'js/one.js', u''), - (SOURCE_HUNK, u'obj.value = "value";', None, u'') - ] - split = self.js_node.split_contents() - split = [(x[0], x[1], x[2], self.js_node.parser.elem_str(x[3])) for x in split] - self.assertEqual(out, split) - -Html5LibParserTests = skipIf( - html5lib is None, 'html5lib not found')(Html5LibParserTests) - - -class BeautifulSoupParserTests(ParserTestCase, CompressorTestCase): - parser_cls = 'compressor.parser.BeautifulSoupParser' - -BeautifulSoupParserTests = skipIf( - BeautifulSoup is None, 'BeautifulSoup not found')(BeautifulSoupParserTests) - - -class HtmlParserTests(ParserTestCase, CompressorTestCase): - parser_cls = 'compressor.parser.HtmlParser' - - -class CssAbsolutizingTestCase(TestCase): - def setUp(self): - settings.COMPRESS_ENABLED = True - settings.COMPRESS_URL = '/media/' - self.css = """ - - - """ - self.css_node = CssCompressor(self.css) - - def test_css_absolute_filter(self): - from compressor.filters.css_default import CssAbsoluteFilter - filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css') - content = "p { background: url('../../images/image.gif') }" - output = "p { background: url('%simages/image.gif?%s') }" % (settings.COMPRESS_URL, get_hashed_mtime(filename)) - filter = CssAbsoluteFilter(content) - self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css')) - settings.COMPRESS_URL = 'http://media.example.com/' - filter = CssAbsoluteFilter(content) - filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css') - output = "p { background: url('%simages/image.gif?%s') }" % (settings.COMPRESS_URL, get_hashed_mtime(filename)) - self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css')) - - def test_css_absolute_filter_https(self): - from compressor.filters.css_default import CssAbsoluteFilter - filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css') - content = "p { background: url('../../images/image.gif') }" - output = "p { background: url('%simages/image.gif?%s') }" % (settings.COMPRESS_URL, get_hashed_mtime(filename)) - filter = CssAbsoluteFilter(content) - self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css')) - settings.COMPRESS_URL = 'https://media.example.com/' - filter = CssAbsoluteFilter(content) - filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css') - output = "p { background: url('%simages/image.gif?%s') }" % (settings.COMPRESS_URL, get_hashed_mtime(filename)) - self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css')) - - def test_css_absolute_filter_relative_path(self): - from compressor.filters.css_default import CssAbsoluteFilter - filename = os.path.join(settings.TEST_DIR, 'whatever', '..', 'media', 'whatever/../css/url/test.css') - content = "p { background: url('../../images/image.gif') }" - output = "p { background: url('%simages/image.gif?%s') }" % (settings.COMPRESS_URL, get_hashed_mtime(filename)) - filter = CssAbsoluteFilter(content) - self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css')) - settings.COMPRESS_URL = 'https://media.example.com/' - filter = CssAbsoluteFilter(content) - output = "p { background: url('%simages/image.gif?%s') }" % (settings.COMPRESS_URL, get_hashed_mtime(filename)) - self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css')) - - def test_css_hunks(self): - hash_dict = { - 'hash1': get_hashed_mtime(os.path.join(settings.COMPRESS_ROOT, 'css/url/url1.css')), - 'hash2': get_hashed_mtime(os.path.join(settings.COMPRESS_ROOT, 'css/url/2/url2.css')), - } - out = [u"p { background: url('/media/images/test.png?%(hash1)s'); }\np { background: url('/media/images/test.png?%(hash1)s'); }\np { background: url('/media/images/test.png?%(hash1)s'); }\np { background: url('/media/images/test.png?%(hash1)s'); }\n" % hash_dict, - u"p { background: url('/media/images/test.png?%(hash2)s'); }\np { background: url('/media/images/test.png?%(hash2)s'); }\np { background: url('/media/images/test.png?%(hash2)s'); }\np { background: url('/media/images/test.png?%(hash2)s'); }\n" % hash_dict] - self.assertEqual(out, list(self.css_node.hunks)) - - -class CssDataUriTestCase(TestCase): - def setUp(self): - settings.COMPRESS_ENABLED = True - settings.COMPRESS_CSS_FILTERS = [ - 'compressor.filters.css_default.CssAbsoluteFilter', - 'compressor.filters.datauri.CssDataUriFilter', - ] - settings.COMPRESS_URL = '/media/' - self.css = """ - - """ - self.css_node = CssCompressor(self.css) - - def test_data_uris(self): - datauri_hash = get_hashed_mtime(os.path.join(settings.COMPRESS_ROOT, 'css/datauri.css')) - out = [u'.add { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJvSURBVDjLpZPrS5NhGIf9W7YvBYOkhlkoqCklWChv2WyKik7blnNris72bi6dus0DLZ0TDxW1odtopDs4D8MDZuLU0kXq61CijSIIasOvv94VTUfLiB74fXngup7nvrnvJABJ/5PfLnTTdcwOj4RsdYmo5glBWP6iOtzwvIKSWstI0Wgx80SBblpKtE9KQs/We7EaWoT/8wbWP61gMmCH0lMDvokT4j25TiQU/ITFkek9Ow6+7WH2gwsmahCPdwyw75uw9HEO2gUZSkfyI9zBPCJOoJ2SMmg46N61YO/rNoa39Xi41oFuXysMfh36/Fp0b7bAfWAH6RGi0HglWNCbzYgJaFjRv6zGuy+b9It96N3SQvNKiV9HvSaDfFEIxXItnPs23BzJQd6DDEVM0OKsoVwBG/1VMzpXVWhbkUM2K4oJBDYuGmbKIJ0qxsAbHfRLzbjcnUbFBIpx/qH3vQv9b3U03IQ/HfFkERTzfFj8w8jSpR7GBE123uFEYAzaDRIqX/2JAtJbDat/COkd7CNBva2cMvq0MGxp0PRSCPF8BXjWG3FgNHc9XPT71Ojy3sMFdfJRCeKxEsVtKwFHwALZfCUk3tIfNR8XiJwc1LmL4dg141JPKtj3WUdNFJqLGFVPC4OkR4BxajTWsChY64wmCnMxsWPCHcutKBxMVp5mxA1S+aMComToaqTRUQknLTH62kHOVEE+VQnjahscNCy0cMBWsSI0TCQcZc5ALkEYckL5A5noWSBhfm2AecMAjbcRWV0pUTh0HE64TNf0mczcnnQyu/MilaFJCae1nw2fbz1DnVOxyGTlKeZft/Ff8x1BRssfACjTwQAAAABJRU5ErkJggg=="); }\n.python { background-image: url("/media/img/python.png?%s"); }\n.datauri { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0 vr4MkhoXe0rZigAAAABJRU5ErkJggg=="); }\n' % datauri_hash] - self.assertEqual(out, list(self.css_node.hunks)) - - -class CssMediaTestCase(TestCase): - def setUp(self): - self.css = """ - - - - - """ - self.css_node = CssCompressor(self.css) - - def test_css_output(self): - links = BeautifulSoup(self.css_node.output()).findAll('link') - media = [u'screen', u'print', u'all', None] - self.assertEqual(len(links), 4) - self.assertEqual(media, [l.get('media', None) for l in links]) - - def test_avoid_reordering_css(self): - css = self.css + '' - node = CssCompressor(css) - media = [u'screen', u'print', u'all', None, u'print'] - links = BeautifulSoup(node.output()).findAll('link') - self.assertEqual(media, [l.get('media', None) for l in links]) - - -class CssMinTestCase(TestCase): - def test_cssmin_filter(self): - from compressor.filters.cssmin import CSSMinFilter - content = """p { - - - background: rgb(51,102,153) url('../../images/image.gif'); - - - } -""" - output = "p{background:#369 url('../../images/image.gif')}" - self.assertEqual(output, CSSMinFilter(content).output()) - -def render(template_string, context_dict=None): - """A shortcut for testing template output.""" - if context_dict is None: - context_dict = {} - - c = Context(context_dict) - t = Template(template_string) - return t.render(c).strip() - - -class TemplatetagTestCase(TestCase): - def setUp(self): - settings.COMPRESS_ENABLED = True - - def test_empty_tag(self): - template = u"""{% load compress %}{% compress js %}{% block js %} - {% endblock %}{% endcompress %}""" - context = { 'MEDIA_URL': settings.COMPRESS_URL } - self.assertEqual(u'', render(template, context)) - - def test_css_tag(self): - template = u"""{% load compress %}{% compress css %} - - - - {% endcompress %} - """ - context = { 'MEDIA_URL': settings.COMPRESS_URL } - out = u'' - self.assertEqual(out, render(template, context)) - - def test_nonascii_css_tag(self): - template = u"""{% load compress %}{% compress css %} - - - {% endcompress %} - """ - context = { 'MEDIA_URL': settings.COMPRESS_URL } - out = '' - self.assertEqual(out, render(template, context)) - - def test_js_tag(self): - template = u"""{% load compress %}{% compress js %} - - - {% endcompress %} - """ - context = { 'MEDIA_URL': settings.COMPRESS_URL } - out = u'' - self.assertEqual(out, render(template, context)) - - def test_nonascii_js_tag(self): - template = u"""{% load compress %}{% compress js %} - - - {% endcompress %} - """ - context = { 'MEDIA_URL': settings.COMPRESS_URL } - out = u'' - self.assertEqual(out, render(template, context)) - - def test_nonascii_latin1_js_tag(self): - template = u"""{% load compress %}{% compress js %} - - - {% endcompress %} - """ - context = { 'MEDIA_URL': settings.COMPRESS_URL } - out = u'' - self.assertEqual(out, render(template, context)) - - def test_compress_tag_with_illegal_arguments(self): - template = u"""{% load compress %}{% compress pony %} - - {% endcompress %}""" - self.assertRaises(TemplateSyntaxError, render, template, {}) - - def test_debug_toggle(self): - template = u"""{% load compress %}{% compress js %} - - - {% endcompress %} - """ - class MockDebugRequest(object): - GET = {settings.COMPRESS_DEBUG_TOGGLE: 'true'} - context = { 'MEDIA_URL': settings.COMPRESS_URL, 'request': MockDebugRequest()} - out = u""" - """ - self.assertEqual(out, render(template, context)) - -class StorageTestCase(TestCase): - def setUp(self): - self._storage = base.default_storage - base.default_storage = get_storage_class('compressor.storage.GzipCompressorFileStorage')() - settings.COMPRESS_ENABLED = True - - def tearDown(self): - base.default_storage = self._storage - - def test_css_tag_with_storage(self): - template = u"""{% load compress %}{% compress css %} - - - - {% endcompress %} - """ - context = { 'MEDIA_URL': settings.COMPRESS_URL } - out = u'' - self.assertEqual(out, render(template, context)) - - -class VerboseTestCase(CompressorTestCase): - - def setUp(self): - super(VerboseTestCase, self).setUp() - settings.COMPRESS_VERBOSE = True - - -class CacheBackendTestCase(CompressorTestCase): - - def test_correct_backend(self): - from compressor.cache import cache - self.assertEqual(cache.__class__, dummy.CacheClass) - - -class OfflineGenerationTestCase(TestCase): - """Uses templates/test_compressor_offline.html""" - maxDiff = None - - def setUp(self): - self._old_compress = settings.COMPRESS_ENABLED - settings.COMPRESS_ENABLED = True - - def tearDown(self): - settings.COMPRESS_ENABLED = self._old_compress - - def test_offline(self): - count, result = CompressCommand().compress() - self.assertEqual(2, count) - self.assertEqual([ - u'\n', - u'', - ], result) - - def test_offline_with_context(self): - self._old_offline_context = settings.COMPRESS_OFFLINE_CONTEXT - settings.COMPRESS_OFFLINE_CONTEXT = { - 'color': 'blue', - } - count, result = CompressCommand().compress() - self.assertEqual(2, count) - self.assertEqual([ - u'\n', - u'', - ], result) - settings.COMPRESS_OFFLINE_CONTEXT = self._old_offline_context - - def test_get_loaders(self): - old_loaders = settings.TEMPLATE_LOADERS - settings.TEMPLATE_LOADERS = ( - ('django.template.loaders.cached.Loader', ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - )), - ) - try: - from django.template.loaders.filesystem import Loader as FileSystemLoader - from django.template.loaders.app_directories import Loader as AppDirectoriesLoader - except ImportError: - pass - else: - loaders = CompressCommand().get_loaders() - self.assertTrue(isinstance(loaders[0], FileSystemLoader)) - self.assertTrue(isinstance(loaders[1], AppDirectoriesLoader)) - finally: - settings.TEMPLATE_LOADERS = old_loaders - -class CssTidyTestCase(TestCase): - def test_tidy(self): - content = """ -/* Some comment */ -font,th,td,p{ -color: black; -} -""" - from compressor.filters.csstidy import CSSTidyFilter - self.assertEqual( - "font,th,td,p{color:#000;}", CSSTidyFilter(content).input()) - -CssTidyTestCase = skipIf( - find_command(settings.COMPRESS_CSSTIDY_BINARY) is None, - 'CSStidy binary %r not found' % settings.COMPRESS_CSSTIDY_BINARY -)(CssTidyTestCase) - - -class CompassTestCase(TestCase): - - def setUp(self): - self.old_debug = settings.DEBUG - self.old_compress_css_filters = settings.COMPRESS_CSS_FILTERS - self.old_compress_url = settings.COMPRESS_URL - self.old_enabled = settings.COMPRESS_ENABLED - settings.DEBUG = True - settings.COMPRESS_ENABLED = True - settings.COMPRESS_CSS_FILTERS = [ - 'compressor.filters.compass.CompassFilter', - 'compressor.filters.css_default.CssAbsoluteFilter', - ] - settings.COMPRESS_URL = '/media/' - - def tearDown(self): - settings.DEBUG = self.old_debug - settings.COMPRESS_URL = self.old_compress_url - settings.COMPRESS_ENABLED = self.old_enabled - settings.COMPRESS_CSS_FILTERS = self.old_compress_css_filters - - def test_compass(self): - template = u"""{% load compress %}{% compress css %} - - - {% endcompress %} - """ - context = {'MEDIA_URL': settings.COMPRESS_URL} - out = u'' - self.assertEqual(out, render(template, context)) - -CompassTestCase = skipIf( - find_command(settings.COMPRESS_COMPASS_BINARY) is None, - 'Compass binary %r not found' % settings.COMPRESS_COMPASS_BINARY -)(CompassTestCase) - - -class PrecompilerTestCase(TestCase): - - def setUp(self): - self.this_dir = os.path.dirname(__file__) - self.filename = os.path.join(self.this_dir, 'media/css/one.css') - with open(self.filename) as f: - self.content = f.read() - self.test_precompiler = os.path.join(self.this_dir, 'precompiler.py') - - def test_precompiler_infile_outfile(self): - command = '%s %s -f {infile} -o {outfile}' % (sys.executable, self.test_precompiler) - compiler = CompilerFilter(content=self.content, filename=self.filename, command=command) - self.assertEqual(u"body { color:#990; }", compiler.input()) - - def test_precompiler_infile_stdout(self): - command = '%s %s -f {infile}' % (sys.executable, self.test_precompiler) - compiler = CompilerFilter(content=self.content, filename=None, command=command) - self.assertEqual(u"body { color:#990; }\n", compiler.input()) - - def test_precompiler_stdin_outfile(self): - command = '%s %s -o {outfile}' % (sys.executable, self.test_precompiler) - compiler = CompilerFilter(content=self.content, filename=None, command=command) - self.assertEqual(u"body { color:#990; }", compiler.input()) - - def test_precompiler_stdin_stdout(self): - command = '%s %s' % (sys.executable, self.test_precompiler) - compiler = CompilerFilter(content=self.content, filename=None, command=command) - self.assertEqual(u"body { color:#990; }\n", compiler.input()) - - def test_precompiler_stdin_stdout_filename(self): - command = '%s %s' % (sys.executable, self.test_precompiler) - compiler = CompilerFilter(content=self.content, filename=self.filename, command=command) - self.assertEqual(u"body { color:#990; }\n", compiler.input()) diff --git a/django_compressor-0.9.2/compressor/utils/__init__.py b/django_compressor-0.9.2/compressor/utils/__init__.py deleted file mode 100755 index 9212134..0000000 --- a/django_compressor-0.9.2/compressor/utils/__init__.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -import os -import sys - -from compressor.exceptions import FilterError - -if sys.version_info < (2, 5): - # Add any http://docs.python.org/library/functions.html?#any to Python < 2.5 - def any(seq): - for item in seq: - if item: - return True - return False - -else: - any = any - - -if sys.version_info < (2, 6): - def walk(root, topdown=True, onerror=None, followlinks=False): - """ - A version of os.walk that can follow symlinks for Python < 2.6 - """ - for dirpath, dirnames, filenames in os.walk(root, topdown, onerror): - yield (dirpath, dirnames, filenames) - if followlinks: - for d in dirnames: - p = os.path.join(dirpath, d) - if os.path.islink(p): - for link_dirpath, link_dirnames, link_filenames in walk(p): - yield (link_dirpath, link_dirnames, link_filenames) -else: - from os import walk - - -def get_class(class_string, exception=FilterError): - """ - Convert a string version of a function name to the callable object. - """ - if not hasattr(class_string, '__bases__'): - try: - class_string = class_string.encode('ascii') - mod_name, class_name = get_mod_func(class_string) - if class_name != '': - cls = getattr(__import__(mod_name, {}, {}, ['']), class_name) - except (ImportError, AttributeError): - pass - else: - return cls - raise exception('Failed to import %s' % class_string) - - -def get_mod_func(callback): - """ - Converts 'django.views.news.stories.story_detail' to - ('django.views.news.stories', 'story_detail') - """ - try: - dot = callback.rindex('.') - except ValueError: - return callback, '' - return callback[:dot], callback[dot + 1:] - - -def get_pathext(default_pathext=None): - """ - Returns the path extensions from environment or a default - """ - if default_pathext is None: - default_pathext = os.pathsep.join(['.COM', '.EXE', '.BAT', '.CMD']) - return os.environ.get('PATHEXT', default_pathext) - -def find_command(cmd, paths=None, pathext=None): - """ - Searches the PATH for the given command and returns its path - """ - if paths is None: - paths = os.environ.get('PATH', '').split(os.pathsep) - if isinstance(paths, basestring): - paths = [paths] - # check if there are funny path extensions for executables, e.g. Windows - if pathext is None: - pathext = get_pathext() - pathext = [ext for ext in pathext.lower().split(os.pathsep)] - # don't use extensions if the command ends with one of them - if os.path.splitext(cmd)[1].lower() in pathext: - pathext = [''] - # check if we find the command on PATH - for path in paths: - # try without extension first - cmd_path = os.path.join(path, cmd) - for ext in pathext: - # then including the extension - cmd_path_ext = cmd_path + ext - if os.path.isfile(cmd_path_ext): - return cmd_path_ext - if os.path.isfile(cmd_path): - return cmd_path - return None diff --git a/django_compressor-0.9.2/compressor/utils/decorators.py b/django_compressor-0.9.2/compressor/utils/decorators.py deleted file mode 100755 index daa2262..0000000 --- a/django_compressor-0.9.2/compressor/utils/decorators.py +++ /dev/null @@ -1,66 +0,0 @@ - - -class cached_property(object): - """Property descriptor that caches the return value - of the get function. - - *Examples* - - .. code-block:: python - - @cached_property - def connection(self): - return Connection() - - @connection.setter # Prepares stored value - def connection(self, value): - if value is None: - raise TypeError("Connection must be a connection") - return value - - @connection.deleter - def connection(self, value): - # Additional action to do at del(self.attr) - if value is not None: - print("Connection %r deleted" % (value, )) - """ - def __init__(self, fget=None, fset=None, fdel=None, doc=None): - self.__get = fget - self.__set = fset - self.__del = fdel - self.__doc__ = doc or fget.__doc__ - self.__name__ = fget.__name__ - self.__module__ = fget.__module__ - - def __get__(self, obj, type=None): - if obj is None: - return self - try: - return obj.__dict__[self.__name__] - except KeyError: - value = obj.__dict__[self.__name__] = self.__get(obj) - return value - - def __set__(self, obj, value): - if obj is None: - return self - if self.__set is not None: - value = self.__set(obj, value) - obj.__dict__[self.__name__] = value - - def __delete__(self, obj): - if obj is None: - return self - try: - value = obj.__dict__.pop(self.__name__) - except KeyError: - pass - else: - if self.__del is not None: - self.__del(obj, value) - - def setter(self, fset): - return self.__class__(self.__get, fset, self.__del) - - def deleter(self, fdel): - return self.__class__(self.__get, self.__set, fdel) diff --git a/django_compressor-0.9.2/compressor/utils/settings.py b/django_compressor-0.9.2/compressor/utils/settings.py deleted file mode 100755 index 736225c..0000000 --- a/django_compressor-0.9.2/compressor/utils/settings.py +++ /dev/null @@ -1,107 +0,0 @@ -from inspect import getmembers -from django.conf import settings - -class AppSettings(object): - """ - An app setting object to be used for handling app setting defaults - gracefully and providing a nice API for them. Say you have an app - called ``myapp`` and want to define a few defaults, and refer to the - defaults easily in the apps code. Add a ``settings.py`` to your app:: - - from path.to.utils import AppSettings - - class MyAppSettings(AppSettings): - SETTING_1 = "one" - SETTING_2 = ( - "two", - ) - - Then initialize the setting with the correct prefix in the location of - of your choice, e.g. ``conf.py`` of the app module:: - - settings = MyAppSettings(prefix="MYAPP") - - The ``MyAppSettings`` instance will automatically look at Django's - global setting to determine each of the settings and respect the - provided ``prefix``. E.g. adding this to your site's ``settings.py`` - will set the ``SETTING_1`` setting accordingly:: - - MYAPP_SETTING_1 = "uno" - - Usage - ----- - - Instead of using ``from django.conf import settings`` as you would - usually do, you can switch to using your apps own settings module - to access the app settings:: - - from myapp.conf import settings - - print myapp_settings.MYAPP_SETTING_1 - - ``AppSettings`` instances also work as pass-throughs for other - global settings that aren't related to the app. For example the - following code is perfectly valid:: - - from myapp.conf import settings - - if "myapp" in settings.INSTALLED_APPS: - print "yay, myapp is installed!" - - Custom handling - --------------- - - Each of the settings can be individually configured with callbacks. - For example, in case a value of a setting depends on other settings - or other dependencies. The following example sets one setting to a - different value depending on a global setting:: - - from django.conf import settings - - class MyCustomAppSettings(AppSettings): - ENABLED = True - - def configure_enabled(self, value): - return value and not self.DEBUG - - custom_settings = MyCustomAppSettings("MYAPP") - - The value of ``custom_settings.MYAPP_ENABLED`` will vary depending on the - value of the global ``DEBUG`` setting. - - Each of the app settings can be customized by providing - a method ``configure_`` that takes the default - value as defined in the class attributes as the only parameter. - The method needs to return the value to be use for the setting in - question. - """ - def __dir__(self): - return sorted(list(set(self.__dict__.keys() + dir(settings)))) - - __members__ = lambda self: self.__dir__() - - def __getattr__(self, name): - if name.startswith(self._prefix): - raise AttributeError("%r object has no attribute %r" % - (self.__class__.__name__, name)) - return getattr(settings, name) - - def __setattr__(self, name, value): - super(AppSettings, self).__setattr__(name, value) - if name in dir(settings): - setattr(settings, name, value) - - def __init__(self, prefix): - super(AppSettings, self).__setattr__('_prefix', prefix) - for name, value in filter(self.issetting, getmembers(self.__class__)): - prefixed_name = "%s_%s" % (prefix.upper(), name.upper()) - value = getattr(settings, prefixed_name, value) - callback = getattr(self, "configure_%s" % name.lower(), None) - if callable(callback): - value = callback(value) - delattr(self.__class__, name) - setattr(self, prefixed_name, value) - - def issetting(self, (name, value)): - return name == name.upper() - diff --git a/django_compressor-0.9.2/compressor/utils/staticfiles.py b/django_compressor-0.9.2/compressor/utils/staticfiles.py deleted file mode 100755 index 1bf8f71..0000000 --- a/django_compressor-0.9.2/compressor/utils/staticfiles.py +++ /dev/null @@ -1,29 +0,0 @@ -from __future__ import absolute_import - -from django.conf import settings as django_settings -from django.core.exceptions import ImproperlyConfigured - -INSTALLED = ("staticfiles" in django_settings.INSTALLED_APPS or - "django.contrib.staticfiles" in django_settings.INSTALLED_APPS) - -finders = None -settings = None - -if INSTALLED: - if "django.contrib.staticfiles" in django_settings.INSTALLED_APPS: - from django.contrib.staticfiles import finders - settings = django_settings - else: - try: - from staticfiles import finders - from staticfiles.conf import settings - except ImportError: - # Old (pre 1.0) and incompatible version of staticfiles - INSTALLED = False - - if (INSTALLED and "compressor.finders.CompressorFinder" - not in settings.STATICFILES_FINDERS): - raise ImproperlyConfigured( - "When using Django Compressor together with staticfiles, " - "please add 'compressor.finders.CompressorFinder' to the " - "STATICFILES_FINDERS setting.") diff --git a/django_compressor-0.9.2/compressor/utils/stringformat.py b/django_compressor-0.9.2/compressor/utils/stringformat.py deleted file mode 100755 index 9c797b6..0000000 --- a/django_compressor-0.9.2/compressor/utils/stringformat.py +++ /dev/null @@ -1,278 +0,0 @@ -# -*- coding: utf-8 -*- -"""Advanced string formatting for Python >= 2.4. - -An implementation of the advanced string formatting (PEP 3101). - -Author: Florent Xicluna -""" - -import re - -if hasattr(str, 'partition'): - def partition(s, sep): - return s.partition(sep) -else: # Python 2.4 - def partition(s, sep): - try: - left, right = s.split(sep, 1) - except ValueError: - return s, '', '' - return left, sep, right - -_format_str_re = re.compile( - r'((?=^])?)' # alignment - r'([-+ ]?)' # sign - r'(#?)' r'(\d*)' r'(,?)' # base prefix, minimal width, thousands sep - r'((?:\.\d+)?)' # precision - r'(.?)$' # type -) -_field_part_re = re.compile( - r'(?:(\[)|\.|^)' # start or '.' or '[' - r'((?(1)[^]]*|[^.[]*))' # part - r'(?(1)(?:\]|$)([^.[]+)?)' # ']' and invalid tail -) - -if hasattr(re, '__version__'): - _format_str_sub = _format_str_re.sub -else: - # Python 2.4 fails to preserve the Unicode type - def _format_str_sub(repl, s): - if isinstance(s, unicode): - return unicode(_format_str_re.sub(repl, s)) - return _format_str_re.sub(repl, s) - -if hasattr(int, '__index__'): - def _is_integer(value): - return hasattr(value, '__index__') -else: # Python 2.4 - def _is_integer(value): - return isinstance(value, (int, long)) - - -def _strformat(value, format_spec=""): - """Internal string formatter. - - It implements the Format Specification Mini-Language. - """ - m = _format_spec_re.match(str(format_spec)) - if not m: - raise ValueError('Invalid conversion specification') - align, sign, prefix, width, comma, precision, conversion = m.groups() - is_numeric = hasattr(value, '__float__') - is_integer = is_numeric and _is_integer(value) - if prefix and not is_integer: - raise ValueError('Alternate form (#) not allowed in %s format ' - 'specifier' % (is_numeric and 'float' or 'string')) - if is_numeric and conversion == 'n': - # Default to 'd' for ints and 'g' for floats - conversion = is_integer and 'd' or 'g' - elif sign: - if not is_numeric: - raise ValueError("Sign not allowed in string format specifier") - if conversion == 'c': - raise ValueError("Sign not allowed with integer " - "format specifier 'c'") - if comma: - # TODO: thousand separator - pass - try: - if ((is_numeric and conversion == 's') or - (not is_integer and conversion in set('cdoxX'))): - raise ValueError - if conversion == 'c': - conversion = 's' - value = chr(value % 256) - rv = ('%' + prefix + precision + (conversion or 's')) % (value,) - except ValueError: - raise ValueError("Unknown format code %r for object of type %r" % - (conversion, value.__class__.__name__)) - if sign not in '-' and value >= 0: - # sign in (' ', '+') - rv = sign + rv - if width: - zero = (width[0] == '0') - width = int(width) - else: - zero = False - width = 0 - # Fastpath when alignment is not required - if width <= len(rv): - if not is_numeric and (align == '=' or (zero and not align)): - raise ValueError("'=' alignment not allowed in string format " - "specifier") - return rv - fill, align = align[:-1], align[-1:] - if not fill: - fill = zero and '0' or ' ' - if align == '^': - padding = width - len(rv) - # tweak the formatting if the padding is odd - if padding % 2: - rv += fill - rv = rv.center(width, fill) - elif align == '=' or (zero and not align): - if not is_numeric: - raise ValueError("'=' alignment not allowed in string format " - "specifier") - if value < 0 or sign not in '-': - rv = rv[0] + rv[1:].rjust(width - 1, fill) - else: - rv = rv.rjust(width, fill) - elif align in ('>', '=') or (is_numeric and not align): - # numeric value right aligned by default - rv = rv.rjust(width, fill) - else: - rv = rv.ljust(width, fill) - return rv - - -def _format_field(value, parts, conv, spec, want_bytes=False): - """Format a replacement field.""" - for k, part, _ in parts: - if k: - if part.isdigit(): - value = value[int(part)] - else: - value = value[part] - else: - value = getattr(value, part) - if conv: - value = ((conv == 'r') and '%r' or '%s') % (value,) - if hasattr(value, '__format__'): - value = value.__format__(spec) - elif hasattr(value, 'strftime') and spec: - value = value.strftime(str(spec)) - else: - value = _strformat(value, spec) - if want_bytes and isinstance(value, unicode): - return str(value) - return value - - -class FormattableString(object): - """Class which implements method format(). - - The method format() behaves like str.format() in python 2.6+. - - >>> FormattableString(u'{a:5}').format(a=42) - ... # Same as u'{a:5}'.format(a=42) - u' 42' - - """ - - __slots__ = '_index', '_kwords', '_nested', '_string', 'format_string' - - def __init__(self, format_string): - self._index = 0 - self._kwords = {} - self._nested = {} - - self.format_string = format_string - self._string = _format_str_sub(self._prepare, format_string) - - def __eq__(self, other): - if isinstance(other, FormattableString): - return self.format_string == other.format_string - # Compare equal with the original string. - return self.format_string == other - - def _prepare(self, match): - # Called for each replacement field. - part = match.group(0) - if part[0] == part[-1]: - # '{{' or '}}' - assert part == part[0] * len(part) - return part[:len(part) // 2] - repl = part[1:-1] - field, _, format_spec = partition(repl, ':') - literal, sep, conversion = partition(field, '!') - if sep and not conversion: - raise ValueError("end of format while looking for " - "conversion specifier") - if len(conversion) > 1: - raise ValueError("expected ':' after format specifier") - if conversion not in 'rsa': - raise ValueError("Unknown conversion specifier %s" % - str(conversion)) - name_parts = _field_part_re.findall(literal) - if literal[:1] in '.[': - # Auto-numbering - if self._index is None: - raise ValueError("cannot switch from manual field " - "specification to automatic field numbering") - name = str(self._index) - self._index += 1 - if not literal: - del name_parts[0] - else: - name = name_parts.pop(0)[1] - if name.isdigit() and self._index is not None: - # Manual specification - if self._index: - raise ValueError("cannot switch from automatic field " - "numbering to manual field specification") - self._index = None - empty_attribute = False - for k, v, tail in name_parts: - if not v: - empty_attribute = True - if tail: - raise ValueError("Only '.' or '[' may follow ']' " - "in format field specifier") - if name_parts and k == '[' and not literal[-1] == ']': - raise ValueError("Missing ']' in format string") - if empty_attribute: - raise ValueError("Empty attribute in format string") - if '{' in format_spec: - format_spec = _format_sub_re.sub(self._prepare, format_spec) - rv = (name_parts, conversion, format_spec) - self._nested.setdefault(name, []).append(rv) - else: - rv = (name_parts, conversion, format_spec) - self._kwords.setdefault(name, []).append(rv) - return r'%%(%s)s' % id(rv) - - def format(self, *args, **kwargs): - """Same as str.format() and unicode.format() in Python 2.6+.""" - if args: - kwargs.update(dict((str(i), value) - for (i, value) in enumerate(args))) - # Encode arguments to ASCII, if format string is bytes - want_bytes = isinstance(self._string, str) - params = {} - for name, items in self._kwords.items(): - value = kwargs[name] - for item in items: - parts, conv, spec = item - params[str(id(item))] = _format_field(value, parts, conv, spec, - want_bytes) - for name, items in self._nested.items(): - value = kwargs[name] - for item in items: - parts, conv, spec = item - spec = spec % params - params[str(id(item))] = _format_field(value, parts, conv, spec, - want_bytes) - return self._string % params - - -def selftest(): - import datetime - F = FormattableString - - assert F(u"{0:{width}.{precision}s}").format('hello world', - width=8, precision=5) == u'hello ' - - d = datetime.date(2010, 9, 7) - assert F(u"The year is {0.year}").format(d) == u"The year is 2010" - assert F(u"Tested on {0:%Y-%m-%d}").format(d) == u"Tested on 2010-09-07" - print 'Test successful' - -if __name__ == '__main__': - selftest() diff --git a/django_compressor-0.9.2/docs/Makefile b/django_compressor-0.9.2/docs/Makefile deleted file mode 100755 index e4de9f8..0000000 --- a/django_compressor-0.9.2/docs/Makefile +++ /dev/null @@ -1,130 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/django-compressor.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/django-compressor.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/django-compressor" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/django-compressor" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - make -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/django_compressor-0.9.2/docs/behind-the-scenes.txt b/django_compressor-0.9.2/docs/behind-the-scenes.txt deleted file mode 100755 index b82edd6..0000000 --- a/django_compressor-0.9.2/docs/behind-the-scenes.txt +++ /dev/null @@ -1,47 +0,0 @@ -Behind the scenes -================= - -This document assumes you already have an up and running instance of -Django Compressor, and that you understand how to use it in your templates. -The goal is to explain what the main template tag, {% compress %}, does -behind the scenes, to help you debug performance problems for instance. - -First step: Offline cache -------------------------- - -The first thing {% compress %} tries to do is get the offline cache for its -nodelist if offline cache is activated. It doesn't parse, doesn't check the -modified times of the files, doesn't even know which files are concerned -actually, since it doesn't look inside the nodelist of the template block -enclosed by the ``compress`` template tag. The cache should return the HTML -containing the element code for the combined file or piece of code (which, -if the cache key exists, is supposed to already exist on disk/custom storage). - -Everything stops here if the cache entry exists. - -Second step: parsing and file list ----------------------------------- - -A compressor instance is created, which in turns instantiates the HTML parser. -The parser is used to determine a file or code hunk list. Each file mtime is -checked, first in cache and then on disk/storage, and this is used to -determine an unique cache key. - -Third step: Checking the "main" cache -------------------------------------- - -Compressor checks if it can get some info about the combined file/hunks -corresponding to its instance, using the cache key obtained in the previous -step. The cache content here will actually be the HTML containing the final -element code, just like in the offline step before. - -Everything stops here if the cache entry exists. - -Fourth step: Generating the combined file if needed ---------------------------------------------------- - -The file is generated if necessary. All precompilers are called and all -filters are executed, and a hash is determined from the contents. This in -turns helps determine the file name, which is only saved if it didn't exist -already. Then the HTML output is returned (and also saved in the cache). -And that's it! diff --git a/django_compressor-0.9.2/docs/changelog.txt b/django_compressor-0.9.2/docs/changelog.txt deleted file mode 100755 index e83f0b4..0000000 --- a/django_compressor-0.9.2/docs/changelog.txt +++ /dev/null @@ -1,163 +0,0 @@ -Changelog -========= - -HEAD ----- - -- Added Compass filter (beta). - -- Fixed compiler filters on Windows. - -- Handle new-style cached template loaders in the compress management command. - -- Documented included filters. - -0.9.2 ------ - -- Fixed stdin handling of precompiler filter. - -0.9.1 ------ - -- Fixed encoding related issue. - -- Minor cleanups. - -0.9 ---- - -- Fixed the precompiler support to also use the full file path instead of a - temporarily created file. - -- Enabled test coverage. - -- Refactored caching and other utility code. - -- Switched from SHA1 to MD5 for hash generation to lower the computational impact. - -0.8 ---- - -- Replace naive jsmin.py with rJSmin (http://opensource.perlig.de/rjsmin/) - and fixed a few problems with JavaScript comments. - -- Fixed converting relative URLs in CSS files when running in debug mode. - -.. note:: - - If you relied on the ``split_contents`` method of ``Compressor`` classes, - please make sure a fourth item is returned in the iterable that denotes - the base name of the file that is compressed. - -0.7.1 ------ - -- Fixed import error when using the standalone django-staticfiles app. - -0.7 ---- - -- Created new parser, HtmlParser, based on the stdlib HTMLParser module. - -- Added a new default AutoSelectParser, which picks the LxmlParser if lxml - is available and falls back to HtmlParser. - -- Use unittest2 for testing goodness. - -- Fixed YUI JavaScript filter argument handling. - -- Updated bundled jsmin to use version by Dave St.Germain that was refactored for speed. - -0.6.4 ------ - -- Fixed Closure filter argument handling. - -0.6.3 ------ - -- Fixed options mangling in CompilerFilter initialization. - -- Fixed tox configuration. - -- Extended documentation and README. - -- In the compress command ignore hidden files when looking for templates. - -- Restructured utilities and added staticfiles compat layer. - -- Restructered parsers and added a html5lib based parser. - -0.6.2 ------ - -- Minor bugfixes that caused the compression not working reliably in - development mode (e.g. updated files didn't trigger a new compression). - -0.6.1 ------ - -- Fixed staticfiles support to also use its finder API to find files during - developement -- when the static files haven't been collected in - ``STATIC_ROOT``. - -- Fixed regression with the ``COMPRESS`` setting, pre-compilation and - staticfiles. - -0.6 ---- - -Major improvements and a lot of bugfixes, some of which are: - -- New precompilation support, which allows compilation of files and - hunks with easily configurable compilers before calling the actual - output filters. See the - :ref:`COMPRESS_PRECOMPILERS ` for more details. - -- New staticfiles support. With the introduction of the staticfiles app - to Django 1.3, compressor officially supports finding the files to - compress using the app's finder API. Have a look at the documentation - about :ref:`remote storages ` in case you want to use - those together with compressor. - -- New ``compress`` management command which allows pre-running of what the - compress template tag does. See the - :ref:`pre-compression ` docs for more information. - -- Various perfomance improvements by better caching and mtime cheking. - -- Deprecated ``COMPRESS_LESSC_BINARY`` setting because it's now - superseded by the :ref:`COMPRESS_PRECOMPILERS ` - setting. Just make sure to use the correct mimetype when linking to less - files or adding inline code and add the following to your settings:: - - COMPRESS_PRECOMPILERS = ( - ('text/less', 'lessc {infile} {outfile}'), - ) - -- Added cssmin_ filter (``compressor.filters.CSSMinFilter``) based on - Zachary Voase's Python port of the YUI CSS compression algorithm. - -- Reimplemented the dog-piling prevention. - -- Make sure the CssAbsoluteFilter works for relative paths. - -- Added inline render mode. See :ref:`usage ` docs. - -- Added ``mtime_cache`` management command to add and/or remove all mtimes - from the cache. - -- Moved docs to Read The Docs: http://django_compressor.readthedocs.org - -- Added optional ``compressor.storage.GzipCompressorFileStorage`` storage - backend that gzips of the saved files automatically for easier deployment. - -- Reimplemented a few filters on top of the new - ``compressor.filters.base.CompilerFilter`` to be a bit more DRY. - -- Added tox based test configuration, testing on Django 1.1-1.3 and Python - 2.5-2.7. - -.. _cssmin: http://pypi.python.org/pypi/cssmin/ - diff --git a/django_compressor-0.9.2/docs/conf.py b/django_compressor-0.9.2/docs/conf.py deleted file mode 100755 index 432fd40..0000000 --- a/django_compressor-0.9.2/docs/conf.py +++ /dev/null @@ -1,216 +0,0 @@ -# -*- coding: utf-8 -*- -# -# django-compressor documentation build configuration file, created by -# sphinx-quickstart on Fri Jan 21 11:47:42 2011. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys, os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# sys.path.insert(0, os.path.abspath('..')) - -# -- General configuration ----------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -# extensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.txt' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Django Compressor' -copyright = u'2011, Django Compressor authors' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '0.9' -# The full version, including alpha/beta/rc tags. -release = '0.9.2' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'murphy' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = ['_theme'] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'django-compressordoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'django-compressor.tex', u'Django Compressor Documentation', - u'Django Compressor authors', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output -------------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'django-compressor', u'Django Compressor Documentation', - [u'Django Compressor authors'], 1) -] diff --git a/django_compressor-0.9.2/docs/index.txt b/django_compressor-0.9.2/docs/index.txt deleted file mode 100755 index 40f3924..0000000 --- a/django_compressor-0.9.2/docs/index.txt +++ /dev/null @@ -1,43 +0,0 @@ -================= -Django Compressor -================= - -Compresses linked and inline JavaScript or CSS into a single cached file. - -Why another static file combiner for Django? -============================================ - -Short version: None of them did exactly what I needed. - -Long version: - -**JS/CSS belong in the templates** - Every static combiner for Django I've seen makes you configure - your static files in your ``settings.py``. While that works, it doesn't make - sense. Static files are for display. And it's not even an option if your - settings are in completely different repositories and use different deploy - processes from the templates that depend on them. - -**Flexibility** - Django Compressor doesn't care if different pages use different combinations - of statics. It doesn't care if you use inline scripts or styles. It doesn't - get in the way. - -**Automatic regeneration and cache-foreverable generated output** - Statics are never stale and browsers can be told to cache the output forever. - -**Full test suite** - I has one. - -Contents -======== - -.. toctree:: - :maxdepth: 1 - - installation - usage - settings - remote-storages - behind-the-scenes - changelog diff --git a/django_compressor-0.9.2/docs/installation.txt b/django_compressor-0.9.2/docs/installation.txt deleted file mode 100755 index 6fa198f..0000000 --- a/django_compressor-0.9.2/docs/installation.txt +++ /dev/null @@ -1,64 +0,0 @@ -Installation -============ - -* Install Django Compressor with your favorite Python package manager:: - - pip install django_compressor - -* Add ``'compressor'`` to your ``INSTALLED_APPS`` setting:: - - INSTALLED_APPS = ( - # other apps - "compressor", - ) - -* See the list of :ref:`settings` to modify Django Compressor's - default behaviour and make adjustments for your website. - -* In case you use Django 1.3's staticfiles_ contrib app (or its standalone - counterpart django-staticfiles_) you have to add Django Compressor's file - finder to the ``STATICFILES_FINDERS`` setting, for example with - ``django.contrib.staticfiles``:: - - STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', - # other finders.. - 'compressor.finders.CompressorFinder', - ) - -.. _staticfiles: http://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/ -.. _django-staticfiles: http://pypi.python.org/pypi/django-staticfiles - -.. _dependencies: - -Dependencies ------------- - -BeautifulSoup_ (optional) -^^^^^^^^^^^^^^^^^^^^^^^^^ - -for the :ref:`parser ` -``compressor.parser.BeautifulSoupParser``:: - - pip install BeautifulSoup - -lxml_ (optional) -^^^^^^^^^^^^^^^^ - -for the :ref:`parser ` ``compressor.parser.LxmlParser``, -also requires libxml2_:: - - STATIC_DEPS=true pip install lxml - -html5lib_ (optional) -^^^^^^^^^^^^^^^^^^^^ - -for the :ref:`parser ` ``compressor.parser.Html5LibParser``:: - - pip install html5lib - -.. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ -.. _lxml: http://codespeak.net/lxml/ -.. _libxml2: http://xmlsoft.org/ -.. _html5lib: http://code.google.com/p/html5lib/ diff --git a/django_compressor-0.9.2/docs/make.bat b/django_compressor-0.9.2/docs/make.bat deleted file mode 100755 index aa5c189..0000000 --- a/django_compressor-0.9.2/docs/make.bat +++ /dev/null @@ -1,170 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. changes to make an overview over all changed/added/deprecated items - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\django-compressor.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\django-compressor.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -:end diff --git a/django_compressor-0.9.2/docs/remote-storages.txt b/django_compressor-0.9.2/docs/remote-storages.txt deleted file mode 100755 index 9e20233..0000000 --- a/django_compressor-0.9.2/docs/remote-storages.txt +++ /dev/null @@ -1,87 +0,0 @@ -.. _remote_storages: - -Remote storages ---------------- - -In some cases it's useful to use a CDN_ for serving static files such as -those generated by Django Compressor. Due to the way Django Compressor -processes files, it requires the files to be processed (in the -``{% compress %}`` block) to be available in a local file system cache. - -Django Compressor provides hooks to automatically have compressed files -pushed to a remote storage backend. Simply -:ref:`set the storage backend ` that saves the result to a -remote service. - -So assuming your CDN is `Amazon S3`_, you can use the boto_ storage backend -from the 3rd party app `django-storages`_. Some required settings are:: - - AWS_ACCESS_KEY_ID = 'XXXXXXXXXXXXXXXXXXXXX' - AWS_SECRET_ACCESS_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' - AWS_STORAGE_BUCKET_NAME = 'compressor-test' - -Next, you need to specify the new CDN base URL and update the URLs to the -files in your templates which you want to compress:: - - COMPRESS_URL = "http://compressor-test.s3.amazon.com/" - -.. note:: - - For staticfiles just set ``STATIC_URL = COMPRESS_URL`` - -The storage backend to save the compressed files needs to be changed, too:: - - COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage' - -Using staticfiles -^^^^^^^^^^^^^^^^^ - -If you are using Django 1.3's staticfiles_ contrib app or the standalone -app django-staticfiles_, you'll need to use a temporary filesystem cache -for Django Compressor to know which files to compress. Since staticfiles -provides a management command to collect static files from various -locations which uses a storage backend, this is where both apps can be -integrated. - -#. Make sure the :ref:`COMPRESS_ROOT ` and STATIC_ROOT_ - settings are equal since both apps need to look at the same directories - when to do their job. - -#. You need to create a subclass of the remote storage backend you want - to use; below is an example of the boto S3 storage backend from - django-storages_:: - - from django.core.files.storage import get_storage_class - from storages.backends.s3boto import S3BotoStorage - - class CachedS3BotoStorage(S3BotoStorage): - """ - S3 storage backend that saves the files locally, too. - """ - def __init__(self, *args, **kwargs): - super(CachedS3BotoStorage, self).__init__(*args, **kwargs) - self.local_storage = get_storage_class( - "compressor.storage.CompressorFileStorage")() - - def save(self, name, content): - name = super(CachedS3BotoStorage, self).save(name, content) - self.local_storage._save(name, content) - return name - -#. Set your :ref:`COMPRESS_STORAGE ` and STATICFILES_STORAGE_ - settings to the dotted path of your custom cached storage backend, e.g. - ``'mysite.storage.CachedS3BotoStorage'``. - -#. To have Django correctly render the URLs to your static files, set the - STATIC_URL_ setting to the same value as :ref:`COMPRESS_URL ` - (e.g. ``"http://compressor-test.s3.amazon.com/"``). - -.. _CDN: http://en.wikipedia.org/wiki/Content_delivery_network -.. _Amazon S3: https://s3.amazonaws.com/ -.. _boto: http://boto.cloudhackers.com/ -.. _django-storages: http://code.welldev.org/django-storages/ -.. _django-staticfiles: http://github.com/jezdez/django-staticfiles/ -.. _staticfiles: http://docs.djangoproject.com/en/dev/howto/static-files/ -.. _STATIC_ROOT: http://docs.djangoproject.com/en/dev/ref/settings/#static-root -.. _STATIC_URL: http://docs.djangoproject.com/en/dev/ref/settings/#static-url -.. _STATICFILES_STORAGE: http://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-storage diff --git a/django_compressor-0.9.2/docs/settings.txt b/django_compressor-0.9.2/docs/settings.txt deleted file mode 100755 index 6d5e872..0000000 --- a/django_compressor-0.9.2/docs/settings.txt +++ /dev/null @@ -1,375 +0,0 @@ -.. _settings: - -Settings --------- - -Django Compressor has a number of settings that control its behavior. -They've been given sensible defaults. - -.. _compress: - -COMPRESS -^^^^^^^^ - -:Default: the opposite of ``DEBUG`` - -Boolean that decides if compression will happen. In order to test compression -when ``DEBUG`` is enabled COMPRESS needs to explicitly be set to ``True``. - -.. _compress_url: - -COMPRESS_URL -^^^^^^^^^^^^ - -:Default: ``STATIC_URL`` (``MEDIA_URL`` for older Django versions) - -Controls the URL that linked files will be read from and compressed files -will be written to. - -.. note:: - - This setting defaults to ``MEDIA_URL`` in case ``STATIC_URL`` - is not given or empty, e.g. on older Django versions (<1.3). - -.. _compress_root: - -COMPRESS_ROOT -^^^^^^^^^^^^^ - -:Default: ``STATIC_ROOT`` (``MEDIA_ROOT`` for older Django versions) - -Controls the absolute file path that linked static will be read from and -compressed static will be written to when using the default COMPRESS_STORAGE_ -``compressor.storage.CompressorFileStorage``. - -.. note:: - - This setting defaults to ``MEDIA_ROOT`` in case ``STATIC_ROOT`` - is not given, e.g. on older Django versions (<1.3). - -COMPRESS_OUTPUT_DIR -^^^^^^^^^^^^^^^^^^^ - -:Default: ``'CACHE'`` - -Controls the directory inside COMPRESS_ROOT_ that compressed files will -be written to. - -COMPRESS_CSS_FILTERS -^^^^^^^^^^^^^^^^^^^^ - -:Default: ``['compressor.filters.css_default.CssAbsoluteFilter']`` - -A list of filters that will be applied to CSS. - -Possible options are: - -``compressor.filters.css_default.CssAbsoluteFilter`` -"""""""""""""""""""""""""""""""""""""""""""""""""""" - -A filter that normalizes the URLs used in ``url()`` CSS statements. - -``compressor.filters.csstidy.CSSTidyFilter`` -"""""""""""""""""""""""""""""""""""""""""""" - -A filter that passes the CSS content to the CSSTidy_ tool. - -- ``COMPRESS_CSSTIDY_BINARY`` -- The CSSTidy binary filesystem path. - -- ``COMPRESS_CSSTIDY_ARGUMENTS`` -- The arguments passed to CSSTidy. - -``compressor.filters.datauri.DataUriFilter`` -"""""""""""""""""""""""""""""""""""""""""""" - -A filter for embedding media as `data: URIs`_ in the CSS. - -- ``COMPRESS_DATA_URI_MIN_SIZE`` -- Only files that are smaller than - this value will be embedded. In bytes. - -``compressor.filters.yui.YUICSSFilter`` -""""""""""""""""""""""""""""""""""""""" - -A filter that passes the CSS content to the `YUI compressor`_. - -- ``COMPRESS_YUI_BINARY`` -- The YUI compressor filesystem path. - -- ``COMPRESS_YUI_CSS_ARGUMENTS``-- The arguments passed to the compressor. - -``compressor.filters.cssmin.CSSMinFilter`` -"""""""""""""""""""""""""""""""""""""""""" - -A filter that uses Zachary Voase's Python port of the YUI CSS compression -algorithm cssmin_. - -``compressor.filters.compass.CompassFilter`` -"""""""""""""""""""""""""""""""""""""""""""" - -A filter that runs Compass_'s compile command. **(BETA)** - -- ``COMPRESS_COMPASS_BINARY`` -- The compass CLI tool filesystem path. - -- ``COMPRESS_COMPASS_ARGUMENTS`` -- The arguments passed to the compass CLI tool. - -- ``COMPRESS_COMPASS_PLUGINS`` -- A list of plugins names that are passed to - compass' require option e.g. ``['my_plugin']`` leads to passing - ``--require my_plugin``. - -.. _CSSTidy: http://csstidy.sourceforge.net/ -.. _`data: URIs`: http://en.wikipedia.org/wiki/Data_URI_scheme -.. _cssmin: http://pypi.python.org/pypi/cssmin/ -.. _Compass: http://compass-style.org/ - - -COMPRESS_JS_FILTERS -^^^^^^^^^^^^^^^^^^^ - -:Default: ``['compressor.filters.jsmin.JSMinFilter']`` - -A list of filters that will be applied to javascript. Possible options are: - -``compressor.filters.jsmin.JSMinFilter`` -""""""""""""""""""""""""""""""""""""""""" - -A filter that uses the jsmin implementation rJSmin_ to compress JavaScript code. - -``compressor.filters.closure.ClosureCompilerFilter`` -"""""""""""""""""""""""""""""""""""""""""""""""""""" - -A filter that uses `Google Closure compiler`_. - -- ``COMPRESS_CLOSURE_COMPILER_BINARY`` -- The Closure compiler filesystem path. - -- ``COMPRESS_CLOSURE_COMPILER_ARGUMENTS`` -- The arguments passed to the compiler. - -``compressor.filters.yui.YUIJSFilter`` -"""""""""""""""""""""""""""""""""""""" - -A filter that passes the JavaScript code to the `YUI compressor`_. - -- ``COMPRESS_YUI_BINARY`` -- The YUI compressor filesystem path. - -- ``COMPRESS_YUI_JS_ARGUMENTS`` -- The arguments passed to the compressor. - -.. _rJSmin: http://opensource.perlig.de/rjsmin/ -.. _`Google Closure compiler`: http://code.google.com/closure/compiler/ -.. _`YUI compressor`: http://developer.yahoo.com/yui/compressor/ - -.. _compress_precompilers: - -COMPRESS_PRECOMPILERS -^^^^^^^^^^^^^^^^^^^^^ - -:Default: ``()`` - -An iterable of two-tuples whose first item is the mimetype of the files or -hunks you want to compile with the command specified as the second item: - -#. mimetype - The mimetype of the file or inline code should that should be compiled. - -#. command - The command to call on each of the files. Modern Python string - formatting will be provided for the two placeholders ``{infile}`` and - ``{outfile}`` whose existence in the command string also triggers the - actual creation of those temporary files. If not given in the command - string, Django Compressor will use ``stdin`` and ``stdout`` respectively - instead. - -Example:: - - COMPRESS_PRECOMPILERS = ( - ('text/coffeescript', 'coffee --compile --stdio'), - ('text/less', 'lessc {infile} {outfile}'), - ('text/x-sass', 'sass {infile} {outfile}'), - ('text/x-scss', 'sass --scss {infile} {outfile}'), - ) - -With that setting (and CoffeeScript_ installed), you could add the following -code to your templates: - -.. code-block:: django - - {% load compress %} - - {% compress js %} - - {% endcompress %} - -This would give you something like this:: - - - -The same works for less_, too: - -.. code-block:: django - - {% load compress %} - - {% compress css %} - - - {% endcompress %} - -Which would be rendered something like:: - - - -.. _less: http://lesscss.org/ -.. _CoffeeScript: http://jashkenas.github.com/coffee-script/ - -.. _compress_storage: - -COMPRESS_STORAGE -^^^^^^^^^^^^^^^^ - -:Default: ``'compressor.storage.CompressorFileStorage'`` - -The dotted path to a Django Storage backend to be used to save the -compressed files. - -Django Compressor ships with one additional storage backend: - -* ``'compressor.storage.GzipCompressorFileStorage'`` - - A subclass of the default storage backend, which will additionally - create ``*.gz`` files of each of the compressed files. - -.. _compress_parser: - -COMPRESS_PARSER -^^^^^^^^^^^^^^^ - -:Default: ``'compressor.parser.AutoSelectParser'`` - -The backend to use when parsing the JavaScript or Stylesheet files. The -``AutoSelectParser`` picks the ``lxml`` based parser when available, and falls -back to ``HtmlParser`` if ``lxml`` is not available. - -``LxmlParser`` is the fastest available parser, but ``HtmlParser`` is not much -slower. ``AutoSelectParser`` adds a slight overhead, but in most cases it -won't be necessary to change the default parser. - -The other two included parsers are considerably slower and should only be -used if absolutely necessary. - -The backends included in Django Compressor: - -- ``compressor.parser.AutoSelectParser`` -- ``compressor.parser.LxmlParser`` -- ``compressor.parser.HtmlParser`` -- ``compressor.parser.BeautifulSoupParser`` -- ``compressor.parser.Html5LibParser`` - -See :ref:`dependencies` for more info about the packages you need -for each parser. - -.. _compress_cache_backend: - -COMPRESS_CACHE_BACKEND -^^^^^^^^^^^^^^^^^^^^^^ - -:Default: ``"default"`` or ``CACHE_BACKEND`` - -The backend to use for caching, in case you want to use a different cache -backend for Django Compressor. - -If you have set the ``CACHES`` setting (new in Django 1.3), -``COMPRESS_CACHE_BACKEND`` defaults to ``"default"``, which is the alias for -the default cache backend. You can set it to a different alias that you have -configured in your ``CACHES`` setting. - -If you have not set ``CACHES`` and are using the old ``CACHE_BACKEND`` -setting, ``COMPRESS_CACHE_BACKEND`` defaults to the ``CACHE_BACKEND`` setting. - -COMPRESS_REBUILD_TIMEOUT -^^^^^^^^^^^^^^^^^^^^^^^^ - -:Default: ``2592000`` (30 days in seconds) - -The period of time after which the compressed files are rebuilt even if -no file changes are detected. - -COMPRESS_MINT_DELAY -^^^^^^^^^^^^^^^^^^^ - -:Default: ``30`` (seconds) - -The upper bound on how long any compression should take to run. Prevents -dog piling, should be a lot smaller than COMPRESS_REBUILD_TIMEOUT_. - -COMPRESS_MTIME_DELAY -^^^^^^^^^^^^^^^^^^^^ - -:Default: ``10`` - -The amount of time (in seconds) to cache the modification timestamp of a -file. Disabled by default. Should be smaller than COMPRESS_REBUILD_TIMEOUT_ -and COMPRESS_MINT_DELAY_. - -COMPRESS_DEBUG_TOGGLE -^^^^^^^^^^^^^^^^^^^^^ - -:Default: None - -The name of the GET variable that toggles the debug mode and prevents Django -Compressor from performing the actual compression. Only useful for debugging. - -.. warning:: - - Don't use this option in production! - - An easy convention is to only set it depending on the ``DEBUG`` setting:: - - if DEBUG: - COMPRESS_DEBUG_TOGGLE = 'whatever' - -.. note:: - - This only works for pages that are rendered using the RequestContext_ - and the ``django.core.context_processors.request`` context processor. - -.. _RequestContext: http://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.RequestContext - -.. _compress_offline: - -COMPRESS_OFFLINE -^^^^^^^^^^^^^^^^ - -:Default: ``False`` - -Boolean that decides if compression should also be done outside of the -request/response loop -- independent from user requests. This allows to -pre-compress CSS and JavaScript files and works just like the automatic -compression with the ``{% compress %}`` tag. - -.. _compress_offline_timeout: - -COMPRESS_OFFLINE_TIMEOUT -^^^^^^^^^^^^^^^^^^^^^^^^ - -:Default: ``31536000`` (1 year in seconds) - -The period of time with which the ``compress`` management command stores -the pre-compressed the contents of ``{% compress %}`` template tags in -the cache. - -.. _compress_offline_context: - -COMPRESS_OFFLINE_CONTEXT -^^^^^^^^^^^^^^^^^^^^^^^^ - -:Default: ``{'MEDIA_URL': settings.MEDIA_URL}`` - -The context to be used by the ``compress`` management command when rendering -the contents of ``{% compress %}`` template tags and saving the result in the -offline cache. diff --git a/django_compressor-0.9.2/docs/usage.txt b/django_compressor-0.9.2/docs/usage.txt deleted file mode 100755 index fa8727d..0000000 --- a/django_compressor-0.9.2/docs/usage.txt +++ /dev/null @@ -1,164 +0,0 @@ -.. _usage: - -Usage -===== - -.. code-block:: django - - {% load compress %} - {% compress [] %} - - {% endcompress %} - -Examples --------- - -.. code-block:: django - - {% load compress %} - - {% compress css %} - - - - {% endcompress %} - -Which would be rendered something like: - -.. code-block:: django - - - -or: - -.. code-block:: django - - {% load compress %} - - {% compress js %} - - - {% endcompress %} - -Which would be rendered something like: - -.. code-block:: django - - - -Linked files **must** be accessible via :ref:`COMPRESS_URL `. - -If the :ref:`COMPRESS ` setting is ``False`` (defaults to the -opposite of DEBUG) the ``compress`` template tag does nothing and simply returns -exactly what it was given. - -If both DEBUG and :ref:`COMPRESS ` are set to ``True``, incompressible -files (off-site or non existent) will throw an exception. If DEBUG is ``False`` -these files will be silently stripped. - -.. warning:: - - For production sites it is **strongly recommended** to use a real cache - backend such as memcached_ to speed up the checks of compressed files. - Make sure you set your Django cache backend appropriately (also see - :ref:`COMPRESS_CACHE_BACKEND ` and - Django's `caching documentation`_). - -The compress template tag supports a second argument specifying the output -mode and defaults to saving the result in a file. Alternatively you can -pass '``inline``' to the template tag to return the content directly to the -rendered page, e.g.: - -.. code-block:: django - - {% load compress %} - - {% compress js inline %} - - - {% endcompress %} - -would be rendered something like:: - - - -.. _memcached: http://memcached.org/ -.. _caching documentation: http://docs.djangoproject.com/en/1.2/topics/cache/#memcached - -.. _pre-compression: - -Pre-compression ---------------- - -Django Compressor comes with an optional ``compress`` management command to -run the compression outside of the request/response loop -- independent -from user requests. This allows to pre-compress CSS and JavaScript files and -works just like the automatic compression with the ``{% compress %}`` tag. - -To compress the files "offline" and update the offline cache you have -to use the ``compress`` management command, ideally during deployment. -Also make sure to enable the :ref:`COMPRESS_OFFLINE ` -setting. In case you don't use the ``compress`` management command, Django -Compressor will automatically fallback to the automatic compression using -the template tag. - -The command parses all templates that can be found with the template -loader (as specified in the TEMPLATE_LOADERS_ setting) and looks for -``{% compress %}`` blocks. It then will use the context as defined in -:ref:`COMPRESS_OFFLINE_CONTEXT ` to render its -content. So if you use any variables inside the ``{% compress %}`` blocks, -make sure to list all values you require in ``COMPRESS_OFFLINE_CONTEXT``. -It's similar to a template context and should be used if a variable is used -in the blocks, e.g.: - -.. code-block:: django - - {% load compress %} - {% compress js %} - - {% endcompress %} - -Since this template requires a variable (``path_to_files``) you need to -specify this in your settings before using the ``compress`` management -command:: - - COMPRESS_OFFLINE_CONTEXT = { - 'path_to_files': '/static/js/', - } - -If not specified, the ``COMPRESS_OFFLINE_CONTEXT`` will by default contain -the commonly used setting to refer to saved files ``MEDIA_URL`` and -``STATIC_URL`` (if specified in the settings). - -The result of running the ``compress`` management command will be saved -in the cache defined in :ref:`COMPRESS_CACHE_BACKEND ` -for the number of seconds defined in the -:ref:`COMPRESS_OFFLINE_TIMEOUT ` setting. - -.. _TEMPLATE_LOADERS: http://docs.djangoproject.com/en/dev/ref/settings/#template-loaders - -CSS Notes ---------- - -All relative ``url()`` bits specified in linked CSS files are automatically -converted to absolute URLs while being processed. Any local absolute URLs (those -starting with a ``'/'``) are left alone. - -Stylesheets that are ``@import``'d are not compressed into the main file. -They are left alone. - -If the media attribute is set on - - - - - - - - -
non-base64 ("")
-
non-base64 ()
-
non-base64 ('')
- -
base64 ("")
-
base64 ()
-
base64 ('')
- - \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/decimals.css b/yuicompressor-2.4.7/tests/decimals.css deleted file mode 100644 index 9593979..0000000 --- a/yuicompressor-2.4.7/tests/decimals.css +++ /dev/null @@ -1,3 +0,0 @@ -::selection { - margin: 0.6px 0.333pt 1.2em 8.8cm; -} diff --git a/yuicompressor-2.4.7/tests/decimals.css.min b/yuicompressor-2.4.7/tests/decimals.css.min deleted file mode 100644 index 4dadedc..0000000 --- a/yuicompressor-2.4.7/tests/decimals.css.min +++ /dev/null @@ -1 +0,0 @@ -::selection{margin:.6px .333pt 1.2em 8.8cm} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/dollar-header.css b/yuicompressor-2.4.7/tests/dollar-header.css deleted file mode 100644 index 43999c4..0000000 --- a/yuicompressor-2.4.7/tests/dollar-header.css +++ /dev/null @@ -1,7 +0,0 @@ -/*! -$Header: /temp/dirname/filename.css 3 2/02/08 3:37p JSmith $ -*/ - -foo { - bar: baz -} diff --git a/yuicompressor-2.4.7/tests/dollar-header.css.min b/yuicompressor-2.4.7/tests/dollar-header.css.min deleted file mode 100644 index 9308100..0000000 --- a/yuicompressor-2.4.7/tests/dollar-header.css.min +++ /dev/null @@ -1,3 +0,0 @@ -/*! -$Header: /temp/dirname/filename.css 3 2/02/08 3:37p JSmith $ -*/foo{bar:baz} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/float.js b/yuicompressor-2.4.7/tests/float.js deleted file mode 100644 index 5e691b8..0000000 --- a/yuicompressor-2.4.7/tests/float.js +++ /dev/null @@ -1,2 +0,0 @@ -obj.css({"float": "left"}); -obj.css({cssFloat:"left"}); \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/float.js.min b/yuicompressor-2.4.7/tests/float.js.min deleted file mode 100644 index 5e28c13..0000000 --- a/yuicompressor-2.4.7/tests/float.js.min +++ /dev/null @@ -1 +0,0 @@ -obj.css({"float":"left"});obj.css({cssFloat:"left"}); \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/font-face.css b/yuicompressor-2.4.7/tests/font-face.css deleted file mode 100644 index 4b6956c..0000000 --- a/yuicompressor-2.4.7/tests/font-face.css +++ /dev/null @@ -1,6 +0,0 @@ -@font-face { - font-family: 'gzipper'; - src: url(yanone.eot); - src: local('gzipper'), - url(yanone.ttf) format('truetype'); -} diff --git a/yuicompressor-2.4.7/tests/font-face.css.min b/yuicompressor-2.4.7/tests/font-face.css.min deleted file mode 100644 index 3a1077c..0000000 --- a/yuicompressor-2.4.7/tests/font-face.css.min +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:'gzipper';src:url(yanone.eot);src:local('gzipper'),url(yanone.ttf) format('truetype')} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/ie5mac.css b/yuicompressor-2.4.7/tests/ie5mac.css deleted file mode 100644 index e4d5204..0000000 --- a/yuicompressor-2.4.7/tests/ie5mac.css +++ /dev/null @@ -1,5 +0,0 @@ -/* Ignore the next rule in IE mac \*/ -.selector { - color: khaki; -} -/* Stop ignoring in IE mac */ diff --git a/yuicompressor-2.4.7/tests/ie5mac.css.min b/yuicompressor-2.4.7/tests/ie5mac.css.min deleted file mode 100644 index f90df41..0000000 --- a/yuicompressor-2.4.7/tests/ie5mac.css.min +++ /dev/null @@ -1 +0,0 @@ -/*\*/.selector{color:khaki}/**/ \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/media-empty-class.css b/yuicompressor-2.4.7/tests/media-empty-class.css deleted file mode 100644 index d2f22d5..0000000 --- a/yuicompressor-2.4.7/tests/media-empty-class.css +++ /dev/null @@ -1,16 +0,0 @@ -/*! preserved */ -emptiness {} - -@import "another.css"; -/* I'm empty - delete me */ -empty { ;} - -@media print { - .noprint { display: none; } -} - -@media screen { - /* this rule should be removed, not simply minified.*/ - .breakme {} - .printonly { display: none; } -} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/media-empty-class.css.min b/yuicompressor-2.4.7/tests/media-empty-class.css.min deleted file mode 100644 index 0350c7f..0000000 --- a/yuicompressor-2.4.7/tests/media-empty-class.css.min +++ /dev/null @@ -1 +0,0 @@ -/*! preserved */@import "another.css";@media print{.noprint{display:none}}@media screen{.printonly{display:none}} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/media-multi.css b/yuicompressor-2.4.7/tests/media-multi.css deleted file mode 100644 index c589771..0000000 --- a/yuicompressor-2.4.7/tests/media-multi.css +++ /dev/null @@ -1,3 +0,0 @@ -@media only all and (max-width:50em), only all and (max-device-width:800px), only all and (max-width:780px) { - some-css : here -} diff --git a/yuicompressor-2.4.7/tests/media-multi.css.min b/yuicompressor-2.4.7/tests/media-multi.css.min deleted file mode 100644 index 57b52f7..0000000 --- a/yuicompressor-2.4.7/tests/media-multi.css.min +++ /dev/null @@ -1 +0,0 @@ -@media only all and (max-width:50em),only all and (max-device-width:800px),only all and (max-width:780px){some-css:here} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/media-test.css b/yuicompressor-2.4.7/tests/media-test.css deleted file mode 100644 index af118ff..0000000 --- a/yuicompressor-2.4.7/tests/media-test.css +++ /dev/null @@ -1,3 +0,0 @@ -@media screen and (-webkit-min-device-pixel-ratio:0) { - some-css : here -} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/media-test.css.min b/yuicompressor-2.4.7/tests/media-test.css.min deleted file mode 100644 index 0e7168e..0000000 --- a/yuicompressor-2.4.7/tests/media-test.css.min +++ /dev/null @@ -1 +0,0 @@ -@media screen and (-webkit-min-device-pixel-ratio:0){some-css:here} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/opacity-filter.css b/yuicompressor-2.4.7/tests/opacity-filter.css deleted file mode 100644 index 60deca7..0000000 --- a/yuicompressor-2.4.7/tests/opacity-filter.css +++ /dev/null @@ -1,14 +0,0 @@ -/* example from https://developer.mozilla.org/en/CSS/opacity */ -pre { /* make the box translucent (80% opaque) */ - border: solid red; - opacity: 0.8; /* Firefox, Safari(WebKit), Opera */ - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE 8 */ - filter: PROGID:DXImageTransform.Microsoft.Alpha(Opacity=80); /* IE 4-7 */ - zoom: 1; /* set "zoom", "width" or "height" to trigger "hasLayout" in IE 7 and lower */ -} - -/** and again */ -code { - -ms-filter: "PROGID:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE 8 */ - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); /* IE 4-7 */ -} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/opacity-filter.css.min b/yuicompressor-2.4.7/tests/opacity-filter.css.min deleted file mode 100644 index 99b4fa8..0000000 --- a/yuicompressor-2.4.7/tests/opacity-filter.css.min +++ /dev/null @@ -1 +0,0 @@ -pre{border:solid red;opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80);zoom:1}code{-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/preserve-case.css b/yuicompressor-2.4.7/tests/preserve-case.css deleted file mode 100644 index 06818f0..0000000 --- a/yuicompressor-2.4.7/tests/preserve-case.css +++ /dev/null @@ -1,15 +0,0 @@ -#AddAddressForm { - padding: 0; -} -#AddAddressForm .messageBoxNeutral { - padding: 0; -} -#FeedbackMailForm{ - padding: 0; -} -#FeedbackMailForm .classe{ - margin: 0; -} -.classes, #FeedBackMailForm { - margin: 0; -} diff --git a/yuicompressor-2.4.7/tests/preserve-case.css.min b/yuicompressor-2.4.7/tests/preserve-case.css.min deleted file mode 100644 index 373bcbb..0000000 --- a/yuicompressor-2.4.7/tests/preserve-case.css.min +++ /dev/null @@ -1 +0,0 @@ -#AddAddressForm{padding:0}#AddAddressForm .messageBoxNeutral{padding:0}#FeedbackMailForm{padding:0}#FeedbackMailForm .classe{margin:0}.classes,#FeedBackMailForm{margin:0} diff --git a/yuicompressor-2.4.7/tests/preserve-new-line.css b/yuicompressor-2.4.7/tests/preserve-new-line.css deleted file mode 100644 index e1f0c92..0000000 --- a/yuicompressor-2.4.7/tests/preserve-new-line.css +++ /dev/null @@ -1,6 +0,0 @@ -#sel-o { - content: "on\"ce upon \ -a time"; - content: 'once upon \ -a ti\'me'; -} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/preserve-new-line.css.min b/yuicompressor-2.4.7/tests/preserve-new-line.css.min deleted file mode 100644 index 6ac20b6..0000000 --- a/yuicompressor-2.4.7/tests/preserve-new-line.css.min +++ /dev/null @@ -1,3 +0,0 @@ -#sel-o{content:"on\"ce upon \ -a time";content:'once upon \ -a ti\'me'} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/preserve-strings.css b/yuicompressor-2.4.7/tests/preserve-strings.css deleted file mode 100644 index 9151373..0000000 --- a/yuicompressor-2.4.7/tests/preserve-strings.css +++ /dev/null @@ -1,7 +0,0 @@ -/* preserving strings */ -.sele { - content: "\"keep \" me"; - something: '\\\' . . '; - else: 'empty{}'; - content: "/* test */"; /* <---- this is not a comment, should be be kept */ -} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/preserve-strings.css.min b/yuicompressor-2.4.7/tests/preserve-strings.css.min deleted file mode 100644 index 3f1d010..0000000 --- a/yuicompressor-2.4.7/tests/preserve-strings.css.min +++ /dev/null @@ -1 +0,0 @@ -.sele{content:"\"keep \" me";something:'\\\' . . ';else:'empty{}';content:"/* test */"} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/pseudo-first.css b/yuicompressor-2.4.7/tests/pseudo-first.css deleted file mode 100644 index dbadef4..0000000 --- a/yuicompressor-2.4.7/tests/pseudo-first.css +++ /dev/null @@ -1,16 +0,0 @@ -/* -because of IE6 first-letter and first-line -must be followed by a space -http://reference.sitepoint.com/css/pseudoelement-firstletter -Thanks: P.Sorokin comment at http://www.phpied.com/cssmin-js/ -*/ -p:first-letter{ - buh: hum; -} -p:first-line{ - baa: 1; -} - -p:first-line,a,p:first-letter,b{ - color: red; -} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/pseudo-first.css.min b/yuicompressor-2.4.7/tests/pseudo-first.css.min deleted file mode 100644 index 687117c..0000000 --- a/yuicompressor-2.4.7/tests/pseudo-first.css.min +++ /dev/null @@ -1 +0,0 @@ -p:first-letter {buh:hum}p:first-line {baa:1}p:first-line ,a,p:first-letter ,b{color:red} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/pseudo.css b/yuicompressor-2.4.7/tests/pseudo.css deleted file mode 100644 index 126a5b1..0000000 --- a/yuicompressor-2.4.7/tests/pseudo.css +++ /dev/null @@ -1,4 +0,0 @@ -p :link { - ba:zinga;;; - foo: bar;;; -} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/pseudo.css.min b/yuicompressor-2.4.7/tests/pseudo.css.min deleted file mode 100644 index bb7f8e7..0000000 --- a/yuicompressor-2.4.7/tests/pseudo.css.min +++ /dev/null @@ -1 +0,0 @@ -p :link{ba:zinga;foo:bar} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/special-comments.css b/yuicompressor-2.4.7/tests/special-comments.css deleted file mode 100644 index 4e184ba..0000000 --- a/yuicompressor-2.4.7/tests/special-comments.css +++ /dev/null @@ -1,13 +0,0 @@ -/*!************88**** - Preserving comments - as they are - ******************** - Keep the initial ! - *******************/ -#yo { - ma: "ma"; -} -/*! -I said -pre- -serve! */ \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/special-comments.css.min b/yuicompressor-2.4.7/tests/special-comments.css.min deleted file mode 100644 index 92ecbac..0000000 --- a/yuicompressor-2.4.7/tests/special-comments.css.min +++ /dev/null @@ -1,9 +0,0 @@ -/*!************88**** - Preserving comments - as they are - ******************** - Keep the initial ! - *******************/#yo{ma:"ma"}/*! -I said -pre- -serve! */ \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/star-underscore-hacks.css b/yuicompressor-2.4.7/tests/star-underscore-hacks.css deleted file mode 100644 index 8b6e517..0000000 --- a/yuicompressor-2.4.7/tests/star-underscore-hacks.css +++ /dev/null @@ -1,5 +0,0 @@ -#elementarr { - width: 1px; - *width: 3pt; - _width: 2em; -} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/star-underscore-hacks.css.min b/yuicompressor-2.4.7/tests/star-underscore-hacks.css.min deleted file mode 100644 index 0a014c3..0000000 --- a/yuicompressor-2.4.7/tests/star-underscore-hacks.css.min +++ /dev/null @@ -1 +0,0 @@ -#elementarr{width:1px;*width:3pt;_width:2em} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/string-in-comment.css b/yuicompressor-2.4.7/tests/string-in-comment.css deleted file mode 100644 index d94d192..0000000 --- a/yuicompressor-2.4.7/tests/string-in-comment.css +++ /dev/null @@ -1,8 +0,0 @@ -/* te " st */ -a{a:1} -/*!"preserve" me*/ -b{content: "/**/"} -/* quite " quote ' \' \" */ -/* ie mac \*/ -c {c : 3} -/* end hiding */ \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/string-in-comment.css.min b/yuicompressor-2.4.7/tests/string-in-comment.css.min deleted file mode 100644 index 7cdec2d..0000000 --- a/yuicompressor-2.4.7/tests/string-in-comment.css.min +++ /dev/null @@ -1 +0,0 @@ -a{a:1}/*!"preserve" me*/b{content:"/**/"}/*\*/c{c:3}/**/ \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/suite.rhino b/yuicompressor-2.4.7/tests/suite.rhino deleted file mode 100644 index 051ed1b..0000000 --- a/yuicompressor-2.4.7/tests/suite.rhino +++ /dev/null @@ -1,3 +0,0 @@ -input = readFile(arguments[0]); -load("../ports/js/cssmin.js"); -print(YAHOO.compressor.cssmin(input)); \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/suite.sh b/yuicompressor-2.4.7/tests/suite.sh deleted file mode 100644 index 46bf5dd..0000000 --- a/yuicompressor-2.4.7/tests/suite.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash - -cd $(dirname $0) - -# Get the jar to use. -jar="$(ls ../build/*.jar | sort | tail -n1)" -echo "jar: $jar" - -runtest () { - testfile="$1" - expected=${testfile/\.FAIL/}.min - expected="$( - cat $expected - )" - filetype="$( - echo $testfile | egrep -o '(cs|j)s' - )" - - if [ "$2" == "cssminjs" ]; then - actual="$( - java -jar ../lib/rhino-1.6R7.jar suite.rhino $testfile - )" - - else - actual="$( - java -jar $jar --type $filetype $testfile - )" - fi - - if [ "$expected" == "$actual" ]; then - echo "Passed: $testfile" > /dev/stderr - else - ( - echo "Test failed: $testfile" - echo "" - echo "Expected:" - echo "$expected" - echo "" - echo "Actual:" - echo "$actual" - ) > /dev/stderr - return 1 - fi -} - - -ls *.FAIL | while read failtest; do - echo "Failing test: " $failtest > /dev/stderr - runtest $failtest && echo "Test passed, please remove the '.FAIL' from the filename" -done - -ls *.{css,js} | while read testfile; do - runtest $testfile || exit 1 -done - -echo -echo "now testing the JS port of CSSMIN..." -ls *.css | while read testfile; do - runtest $testfile "cssminjs" || exit 1 -done - -exit 0 diff --git a/yuicompressor-2.4.7/tests/webkit-transform.css b/yuicompressor-2.4.7/tests/webkit-transform.css deleted file mode 100644 index 83a50f2..0000000 --- a/yuicompressor-2.4.7/tests/webkit-transform.css +++ /dev/null @@ -1,2 +0,0 @@ -c {-webkit-transform-origin: 0 0;} -d {-MOZ-TRANSFORM-ORIGIN: 0 0 } \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/webkit-transform.css.min b/yuicompressor-2.4.7/tests/webkit-transform.css.min deleted file mode 100644 index b640ddf..0000000 --- a/yuicompressor-2.4.7/tests/webkit-transform.css.min +++ /dev/null @@ -1 +0,0 @@ -c{-webkit-transform-origin:0 0}d{-moz-transform-origin:0 0} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tests/zeros.css b/yuicompressor-2.4.7/tests/zeros.css deleted file mode 100644 index a5a4da2..0000000 --- a/yuicompressor-2.4.7/tests/zeros.css +++ /dev/null @@ -1,6 +0,0 @@ -a { - margin: 0px 0pt 0em 0%; - _padding-top: 0ex; - background-position: 0 0; - padding: 0in 0cm 0mm 0pc -} diff --git a/yuicompressor-2.4.7/tests/zeros.css.min b/yuicompressor-2.4.7/tests/zeros.css.min deleted file mode 100644 index 14ac7a9..0000000 --- a/yuicompressor-2.4.7/tests/zeros.css.min +++ /dev/null @@ -1 +0,0 @@ -a{margin:0;_padding-top:0;background-position:0 0;padding:0} \ No newline at end of file diff --git a/yuicompressor-2.4.7/tools/cssmin-debugger.html b/yuicompressor-2.4.7/tools/cssmin-debugger.html deleted file mode 100644 index e6374f2..0000000 --- a/yuicompressor-2.4.7/tools/cssmin-debugger.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - -

Use This Page to Debug cssmin.js

- -

Your browser does not support the local file access apis used by this page.

- -

Select a css file to compress. You can then step through the cssmin.js implementation using your browser's script debugger.

- -

- -

Compressed

-

-
-        

Original

-

-
-        
-    
-
\ No newline at end of file