update docs

This commit is contained in:
ndparker 2015-10-11 17:47:02 +02:00
parent cd226ddc8e
commit 16070d3556
14 changed files with 86 additions and 82 deletions

View File

@ -35,10 +35,10 @@ Here's a feature list:
- Strings are kept, except that escaped newlines are stripped
- Space/Comments before the very end or before various characters are
stripped: ``:{});=>+],!`` (The colon (``:``) is a special case, a single
stripped: ``:{});=>],!`` (The colon (``:``) is a special case, a single
space is kept if it's outside a ruleset.)
- Space/Comments at the very beginning or after various characters are
stripped: ``{}(=:>+[,!``
stripped: ``{}(=:>[,!``
- Optional space after unicode escapes is kept, resp. replaced by a simple
space
- whitespaces inside ``url()`` definitions are stripped
@ -69,7 +69,7 @@ distribution contains the details.
COPYRIGHT AND LICENSE
---------------------
Copyright 2011 - 2014
Copyright 2011 - 2015
André Malo or his licensors, as applicable.
The whole package (except for the files in the bench/ directory)

View File

@ -8,7 +8,7 @@ cleanup() {
out="$(mktemp)"
trap cleanup EXIT
for v in 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5 2.4; do
for v in 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5 2.4; do
(
set -e

View File

@ -8,7 +8,7 @@ Benchmark cssmin implementations.
:Copyright:
Copyright 2011 - 2014
Copyright 2011 - 2015
Andr\xe9 Malo or his licensors, as applicable
:License:

View File

@ -9,7 +9,7 @@ Benchmark cssmin implementations.
:Copyright:
Copyright 2011 - 2014
Copyright 2011 - 2015
Andr\xe9 Malo or his licensors, as applicable
:License:

View File

@ -9,7 +9,7 @@ Write benchmark results.
:Copyright:
Copyright 2014
Copyright 2014 - 2015
Andr\xe9 Malo or his licensors, as applicable
:License:

View File

@ -1,16 +1,31 @@
$ python3.4 -OO bench/main.py bench/*.css
$ python3.5 -OO bench/main.py bench/*.css
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python Release: 3.4.2
Python Release: 3.5.0
Benchmarking 'bench/wikipedia.css'... (81.0 KiB)
Timing cssmin ... ( 49.4 KiB *) 163.11 ms
Timing rcssmin ... ( 49.6 KiB >) 45.48 ms (factor: 3.59)
Timing _rcssmin ... ( 49.6 KiB >) 0.43 ms (factor: 378.93, 105.66)
Timing cssmin ... ( 49.4 KiB *) 176.97 ms
Timing rcssmin ... ( 49.6 KiB >) 45.02 ms (factor: 3.93)
Timing _rcssmin ... ( 49.6 KiB >) 0.50 ms (factor: 352.17, 89.59)
Benchmarking 'bench/wikipedia.min.css'... (49.4 KiB)
Timing cssmin ... ( 49.4 KiB *) 119.00 ms
Timing rcssmin ... ( 49.4 KiB =) 20.94 ms (factor: 5.68)
Timing _rcssmin ... ( 49.4 KiB =) 0.26 ms (factor: 454.45, 79.98)
Timing cssmin ... ( 49.4 KiB *) 127.64 ms
Timing rcssmin ... ( 49.4 KiB =) 20.62 ms (factor: 6.19)
Timing _rcssmin ... ( 49.4 KiB =) 0.31 ms (factor: 415.84, 67.17)
$ python3.4 -OO bench/main.py bench/*.css
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python Release: 3.4.3
Benchmarking 'bench/wikipedia.css'... (81.0 KiB)
Timing cssmin ... ( 49.4 KiB *) 162.24 ms
Timing rcssmin ... ( 49.6 KiB >) 46.65 ms (factor: 3.48)
Timing _rcssmin ... ( 49.6 KiB >) 0.47 ms (factor: 341.76, 98.27)
Benchmarking 'bench/wikipedia.min.css'... (49.4 KiB)
Timing cssmin ... ( 49.4 KiB *) 114.43 ms
Timing rcssmin ... ( 49.4 KiB =) 21.15 ms (factor: 5.41)
Timing _rcssmin ... ( 49.4 KiB =) 0.29 ms (factor: 388.69, 71.83)
$ python3.3 -OO bench/main.py bench/*.css
@ -18,44 +33,29 @@ $ python3.3 -OO bench/main.py bench/*.css
Python Release: 3.3.5
Benchmarking 'bench/wikipedia.css'... (81.0 KiB)
Timing cssmin ... ( 49.4 KiB *) 185.01 ms
Timing rcssmin ... ( 49.6 KiB >) 59.30 ms (factor: 3.12)
Timing _rcssmin ... ( 49.6 KiB >) 0.52 ms (factor: 356.38, 114.23)
Timing cssmin ... ( 49.4 KiB *) 176.28 ms
Timing rcssmin ... ( 49.6 KiB >) 59.31 ms (factor: 2.97)
Timing _rcssmin ... ( 49.6 KiB >) 0.56 ms (factor: 313.42, 105.46)
Benchmarking 'bench/wikipedia.min.css'... (49.4 KiB)
Timing cssmin ... ( 49.4 KiB *) 136.26 ms
Timing rcssmin ... ( 49.4 KiB =) 25.51 ms (factor: 5.34)
Timing _rcssmin ... ( 49.4 KiB =) 0.26 ms (factor: 515.24, 96.47)
$ python3.2 -OO bench/main.py bench/*.css
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python Release: 3.2.5
Benchmarking 'bench/wikipedia.css'... (81.0 KiB)
Timing cssmin ... ( 49.4 KiB *) 225.32 ms
Timing rcssmin ... ( 49.6 KiB >) 57.51 ms (factor: 3.92)
Timing _rcssmin ... ( 49.6 KiB >) 0.43 ms (factor: 527.98, 134.77)
Benchmarking 'bench/wikipedia.min.css'... (49.4 KiB)
Timing cssmin ... ( 49.4 KiB *) 129.43 ms
Timing rcssmin ... ( 49.4 KiB =) 24.45 ms (factor: 5.29)
Timing _rcssmin ... ( 49.4 KiB =) 0.25 ms (factor: 526.94, 99.55)
Timing cssmin ... ( 49.4 KiB *) 127.05 ms
Timing rcssmin ... ( 49.4 KiB =) 25.16 ms (factor: 5.05)
Timing _rcssmin ... ( 49.4 KiB =) 0.30 ms (factor: 430.40, 85.23)
$ python2.7 -OO bench/main.py bench/*.css
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python Release: 2.7.7
Python Release: 2.7.10
Benchmarking 'bench/wikipedia.css'... (81.0 KiB)
Timing cssmin ... ( 49.4 KiB *) 175.98 ms
Timing rcssmin ... ( 49.6 KiB >) 46.22 ms (factor: 3.81)
Timing _rcssmin ... ( 49.6 KiB >) 0.45 ms (factor: 390.95, 102.68)
Timing cssmin ... ( 49.4 KiB *) 180.53 ms
Timing rcssmin ... ( 49.6 KiB >) 48.51 ms (factor: 3.72)
Timing _rcssmin ... ( 49.6 KiB >) 0.43 ms (factor: 418.14, 112.36)
Benchmarking 'bench/wikipedia.min.css'... (49.4 KiB)
Timing cssmin ... ( 49.4 KiB *) 126.19 ms
Timing rcssmin ... ( 49.4 KiB =) 19.92 ms (factor: 6.33)
Timing _rcssmin ... ( 49.4 KiB =) 0.27 ms (factor: 469.78, 74.17)
Timing cssmin ... ( 49.4 KiB *) 130.12 ms
Timing rcssmin ... ( 49.4 KiB =) 23.91 ms (factor: 5.44)
Timing _rcssmin ... ( 49.4 KiB =) 0.34 ms (factor: 379.68, 69.75)
# vim: nowrap

View File

@ -1,5 +1,11 @@
Changes with version
*) Fix minification of calc() calls. (Issue #1)
*) Benchmark updates
*) Lift max restrictions for CPython and Jython as well.
*) Lift max restrictions for pypy versions. Added pypy3 support.

View File

@ -18,10 +18,10 @@ Here's a feature list:
- Strings are kept, except that escaped newlines are stripped
- Space/Comments before the very end or before various characters are
stripped: ``:{});=>+],!`` (The colon (``:``) is a special case, a single
stripped: ``:{});=>],!`` (The colon (``:``) is a special case, a single
space is kept if it's outside a ruleset.)
- Space/Comments at the very beginning or after various characters are
stripped: ``{}(=:>+[,!``
stripped: ``{}(=:>[,!``
- Optional space after unicode escapes is kept, resp. replaced by a simple
space
- whitespaces inside ``url()`` definitions are stripped
@ -54,7 +54,7 @@ Both python 2 (>= 2.4) and python 3 are supported.
Copyright and License
~~~~~~~~~~~~~~~~~~~~~
Copyright 2011 - 2014
Copyright 2011 - 2015
André Malo or his licensors, as applicable.
The whole package (except for the files in the bench/ directory) is

View File

@ -1,5 +1,5 @@
.. license:
Copyright 2011 - 2014
Copyright 2011 - 2015
André Malo or his licensors, as applicable
Licensed under the Apache License, Version 2.0 (the "License");
@ -35,10 +35,10 @@ Here's a feature list:
- Strings are kept, except that escaped newlines are stripped
- Space/Comments before the very end or before various characters are
stripped: ``:{});=>+],!`` (The colon (``:``) is a special case, a single
stripped: ``:{});=>],!`` (The colon (``:``) is a special case, a single
space is kept if it's outside a ruleset.)
- Space/Comments at the very beginning or after various characters are
stripped: ``{}(=:>+[,!``
stripped: ``{}(=:>[,!``
- Optional space after unicode escapes is kept, resp. replaced by a simple
space
- whitespaces inside ``url()`` definitions are stripped
@ -130,34 +130,34 @@ looks like this:
.. sourcecode:: text
pattern = (
r'([^\\"\047u>@\r\n\f\040\t/;:{}]+)|(?<=[{}(=:>+[,!])((?:[\r\n\f\040'
r'([^\\"\047u>@\r\n\f\040\t/;:{}+]+)|(?<=[{}(=:>[,!])((?:[\r\n\f\040'
r'\t]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)|^((?:[\r\n\f\040\t]|(?:/'
r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)|((?:[\r\n\f\040\t]|(?:/\*[^*]*\*'
r'+(?:[^/*][^*]*\*+)*/))+)(?=(([:{});=>+\],!])|$)?)|;((?:[\r\n\f\040'
r'+(?:[^/*][^*]*\*+)*/))+)(?=(([:{});=>\],!])|$)?)|;((?:[\r\n\f\040'
r'\t]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:;(?:[\r\n\f\040\t]|(?:/'
r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)(?=(\})?)|(\{)|(\})|((?:(?:\047'
r'[^\047\\\r\n\f]*(?:\\[^\r\n\f][^\047\\\r\n\f]*)*\047)|(?:"[^"\\\r\n'
r'\f]*(?:\\[^\r\n\f][^"\\\r\n\f]*)*")))|(?<![^\000-\054\056\057\072-'
r'\100\133-\136\140\173-\177])url\([\r\n\f\040\t]*((?:(?:\047[^\047'
r'\\]*(?:\\(?:[^\r]|\r\n?)[^\047\\]*)*\047)|(?:"[^"\\]*(?:\\(?:[^\r]'
r'|\r\n?)[^"\\]*)*"))|(?:(?:[^\000-\040"\047()\\\177]*(?:(?:\\(?:[0-'
r'9a-fA-F]{1,6}(?:[\040\n\t\f]|\r\n?)?|[^\n\r\f0-9a-fA-F]))[^\000-\0'
r'40"\047()\\\177]*)*)(?:(?:[\r\n\f\040\t]+|(?:\\(?:[\n\f]|\r\n?))+)'
r'(?:(?:[^\000-\040"\047()\\\177]|(?:\\(?:[0-9a-fA-F]{1,6}(?:[\040\n'
r'\t\f]|\r\n?)?|[^\n\r\f0-9a-fA-F]))|(?:\\(?:[\n\f]|\r\n?)))[^\000-'
r'\040"\047()\\\177]*(?:(?:\\(?:[0-9a-fA-F]{1,6}(?:[\040\n\t\f]|\r\n'
r'?)?|[^\n\r\f0-9a-fA-F]))[^\000-\040"\047()\\\177]*)*)+)*))[\r\n\f'
r'\040\t]*\)|(@(?:[mM][eE][dD][iI][aA]|[sS][uU][pP][pP][oO][rR][tT]['
r'sS]|[dD][oO][cC][uU][mM][eE][nN][tT]|(?:-(?:[wW][eE][bB][kK][iI][t'
r'T]|[mM][oO][zZ]|[oO]|[mM][sS])-)?[kK][eE][yY][fF][rR][aA][mM][eE]['
r'sS]))(?![^\000-\054\056\057\072-\100\133-\136\140\173-\177])|((?:>'
r'/\*\*/))((?:[\r\n\f\040\t]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)|('
r':[fF][iI][rR][sS][tT]-[lL](?:[iI][nN][eE]|[eE][tT][tT][eE][rR]))(('
r'?:[\r\n\f\040\t]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)(?=[{,])|((?'
r':(?:\047[^\047\\\r\n\f]*(?:\\(?:[^\r]|\r\n?)[^\047\\\r\n\f]*)*\047'
r')|(?:"[^"\\\r\n\f]*(?:\\(?:[^\r]|\r\n?)[^"\\\r\n\f]*)*")))|((?:\\('
r'?:[0-9a-fA-F]{1,6}(?:[\040\n\t\f]|\r\n?)?|[^\n\r\f0-9a-fA-F]))[^'
r'\\"\047u>@\r\n\f\040\t/;:{}]*)'
r'[^\047\\\r\n\f]*(?:\\[^\r\n\f][^\047\\\r\n\f]*)*\047)|(?:"[^"\\\r'
r'\n\f]*(?:\\[^\r\n\f][^"\\\r\n\f]*)*")))|(?<![^\000-\054\056\057\07'
r'2-\100\133-\136\140\173-\177])url\([\r\n\f\040\t]*((?:(?:\047[^\04'
r'7\\]*(?:\\(?:[^\r]|\r\n?)[^\047\\]*)*\047)|(?:"[^"\\]*(?:\\(?:[^\r'
r']|\r\n?)[^"\\]*)*"))|(?:(?:[^\000-\040"\047()\\\177]*(?:(?:\\(?:[0'
r'-9a-fA-F]{1,6}(?:[\040\n\t\f]|\r\n?)?|[^\n\r\f0-9a-fA-F]))[^\000-'
r'\040"\047()\\\177]*)*)(?:(?:[\r\n\f\040\t]+|(?:\\(?:[\n\f]|\r\n?))'
r'+)(?:(?:[^\000-\040"\047()\\\177]|(?:\\(?:[0-9a-fA-F]{1,6}(?:[\040'
r'\n\t\f]|\r\n?)?|[^\n\r\f0-9a-fA-F]))|(?:\\(?:[\n\f]|\r\n?)))[^\000'
r'-\040"\047()\\\177]*(?:(?:\\(?:[0-9a-fA-F]{1,6}(?:[\040\n\t\f]|\r'
r'\n?)?|[^\n\r\f0-9a-fA-F]))[^\000-\040"\047()\\\177]*)*)+)*))[\r\n'
r'\f\040\t]*\)|(@(?:[mM][eE][dD][iI][aA]|[sS][uU][pP][pP][oO][rR][tT'
r'][sS]|[dD][oO][cC][uU][mM][eE][nN][tT]|(?:-(?:[wW][eE][bB][kK][iI]'
r'[tT]|[mM][oO][zZ]|[oO]|[mM][sS])-)?[kK][eE][yY][fF][rR][aA][mM][eE'
r'][sS]))(?![^\000-\054\056\057\072-\100\133-\136\140\173-\177])|((?'
r':>/\*\*/))((?:[\r\n\f\040\t]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)'
r'|(:[fF][iI][rR][sS][tT]-[lL](?:[iI][nN][eE]|[eE][tT][tT][eE][rR]))'
r'((?:[\r\n\f\040\t]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)(?=[{,])|('
r'(?:(?:\047[^\047\\\r\n\f]*(?:\\(?:[^\r]|\r\n?)[^\047\\\r\n\f]*)*\0'
r'47)|(?:"[^"\\\r\n\f]*(?:\\(?:[^\r]|\r\n?)[^"\\\r\n\f]*)*")))|((?:'
r'\\(?:[0-9a-fA-F]{1,6}(?:[\040\n\t\f]|\r\n?)?|[^\n\r\f0-9a-fA-F]))['
r'^\\"\047u>@\r\n\f\040\t/;:{}+]*)'
)

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: ascii -*-
#
# Copyright 2006 - 2014
# Copyright 2006 - 2015
# Andr\xe9 Malo or his licensors, as applicable
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2009 - 2014
# Copyright 2009 - 2015
# André Malo or his licensors, as applicable
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -19,11 +19,9 @@
name = rcssmin
python.min = 2.3
python.max = 3.4
pypy.min = 1.9
pypy3.min = 2.4
jython.min = 2.5
jython.max = 2.7
version.number = 1.0.5

View File

@ -1,5 +1,5 @@
/*
* Copyright 2011 - 2014
* Copyright 2011 - 2015
* Andr\xe9 Malo or his licensors, as applicable
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -12,7 +12,7 @@ itself is based on `the rule list by Isaac Schlueter`_\\.
:Copyright:
Copyright 2011 - 2014
Copyright 2011 - 2015
Andr\xe9 Malo or his licensors, as applicable
:License:
@ -40,10 +40,10 @@ Here's a feature list:
- Strings are kept, except that escaped newlines are stripped
- Space/Comments before the very end or before various characters are
stripped: ``:{});=>+],!`` (The colon (``:``) is a special case, a single
stripped: ``:{});=>],!`` (The colon (``:``) is a special case, a single
space is kept if it's outside a ruleset.)
- Space/Comments at the very beginning or after various characters are
stripped: ``{}(=:>+[,!``
stripped: ``{}(=:>[,!``
- Optional space after unicode escapes is kept, resp. replaced by a simple
space
- whitespaces inside ``url()`` definitions are stripped

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: ascii -*-
#
# Copyright 2014
# Copyright 2014 - 2015
# Andr\xe9 Malo or his licensors, as applicable
#
# Licensed under the Apache License, Version 2.0 (the "License");