diff --git a/blowdrycss/colorparser.py b/blowdrycss/colorparser.py index 4da8ebe..2e73c03 100644 --- a/blowdrycss/colorparser.py +++ b/blowdrycss/colorparser.py @@ -34,6 +34,9 @@ class ColorParser(object): + """ Extracts plain text, hexidecimal, rgb, rgba, hsl, and hsla color codes from encoded class selectors. + + """ def __init__(self, property_name='', value=''): self.color_regexes = property_regex_dict['color'] self.property_name = property_name diff --git a/blowdrycss/datalibrary.py b/blowdrycss/datalibrary.py index b7d70d1..1c90b7c 100644 --- a/blowdrycss/datalibrary.py +++ b/blowdrycss/datalibrary.py @@ -141,8 +141,9 @@ def __init__(self): 'color': { r"(h[0-9a-fA-F]{3} ?)$", r"(h[0-9a-fA-F]{6} ?)$", r"(h[0-9a-fA-F]{3}-i ?)$", r"(h[0-9a-fA-F]{6}-i ?)$", - r"(h[0-9a-fA-F]{3}.*?-i ?)$", r"(h[0-9a-fA-F]{6}.*-i ?)$", - r"(h[0-9a-fA-F]{3}-i.*? ?)$", r"(h[0-9a-fA-F]{6}-i.*? ?)$", + r"(h[0-9a-fA-F]{3}-.*? ?)$", r"(h[0-9a-fA-F]{6}-.* ?)$", + r"(h[0-9a-fA-F]{3}-.*?-i ?)$", r"(h[0-9a-fA-F]{6}-.*-i ?)$", + r"(h[0-9a-fA-F]{3}-i-.*? ?)$", r"(h[0-9a-fA-F]{6}-i-.*? ?)$", }, } diff --git a/blowdrycss/unit_tests/test_colorParser.py b/blowdrycss/unit_tests/test_colorParser.py index 83fb49d..cce656e 100644 --- a/blowdrycss/unit_tests/test_colorParser.py +++ b/blowdrycss/unit_tests/test_colorParser.py @@ -32,15 +32,15 @@ def test_is_valid_hex_Integer_case(self): 'h0ff48f', 'hfff', ' hABC123 ', 'hfdec78', 'h000', ' hbcd ', '5px solid hd0d', '5px-hidden-hd0d987', '13px dashed hd0d', 'h000-i', 'h484848-i', - 'hf2f-hover-i', 'hF3F-i-hover', 'color-hf4f-hover-i', 'color-hf5f-i-hover', - 'hf2f2f2-hover-i', 'hf3f3f3-i-hover', 'color-hf4f4f4f-hover-i', 'color-hf5f5f5-i-hover', + 'hd9d-hover', 'hd9d9d8-hover', 'hf2f-hover-i', 'hF3F-i-hover', + 'hf2f2f2-hover-i', 'hf3f3f3-i-hover', ] expected = [ 0, 0, 1, 0, 0, 1, 10, 11, 12, 0, 0, - 0, 0, 6, 6, - 0, 0, 6, 6, + 0, 0, 0, 0, + 0, 0, ] color_parser = ColorParser() for i, value in enumerate(values_true): diff --git a/readme.rst b/readme.rst index 3b6f49f..e308c89 100644 --- a/readme.rst +++ b/readme.rst @@ -27,13 +27,6 @@ Version Changelog | See ``version.py`` for full changelog. | -| **0.2.5** -- Fixed two regex errors: URIs (http://, ftp://) resemble inline JS comments (//) and ``://`` - needs to be removed first and foremost. XHTML multi--line comment syntax ``<%-- ... --%>`` needs to be removed - before ``<%...%>`` standard XHTML decorated expressions are removed since the regex is non-greedy and - an XHTML expression decorated with ``<%...%>`` may exist within the multi-line comment. This results in an - early non-greedy match between ``<%--`` and the closing ``%>`` of a commented out expression. - Which contrasts with the desired closing substring of ``--%>``. -| | **0.2.6** -- Created a filehandler.FileModificationComparator which runs under watchdog mode. This feature dramatically improves efficiency by only adding classes based on the files that changed before the last run of blowdrycss. The current CSS class selectors are now stored within the @@ -58,6 +51,11 @@ Version Changelog PEP8 and typo corrections. +| **0.2.7** -- Added a call to LimitTimer.reset() to fix a bug in which the LimitTimer never expired. + Add two more color regexes which allow the case in which hex is be combined with a pseudo class. + e.g. ``hffffff-hover`` or ``hfff-before``. + + Why the name blowdrycss? ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/version.py b/version.py index 0a0f407..4807f90 100644 --- a/version.py +++ b/version.py @@ -183,12 +183,15 @@ class declarations, CssClass, and ``*Attributes.Add("class", "bold padding-42"); PEP8 and typo corrections. + | **0.2.7** -- Added a call to LimitTimer.reset() to fix a bug in which the LimitTimer never expired. + Add two more color regexes which allow the case in which hex is be combined with a pseudo class. + e.g. ``hffffff-hover`` or ``hfff-before``. """ __author__ = 'chad nelson' __project__ = 'blowdrycss' -__version__ = '0.2.6' +__version__ = '0.2.7' __release__ = __version__ + 'b2'