Commits

cthedot committed e5ce93d

prepared release

  • Participants
  • Parent commits 4a7ebf4
  • Tags TAG_0.9.6a3

Comments (0)

Files changed (3)

 
 about this release
 ------------------
-0.9.6a2 is an alpha release.
+0.9.6a3 is an bugfix release.
 
 main changes
 ------------
-0.9.6a2 090308
-    + **API CHANGE**: :class:`cssutils.profiles.Profiles` (introduced in 0.9.6a1) has been refactored
+0.9.6a3 090426
+    - **IMPROVEMENT**: Fix for Python 2.6.2 (due to a backport from Python 2.7 to 2.6.2 the reversed() iterator has no __length__ anymore which cssutils was using)
 
-    + **CHANGE**: Reporting levels of properties have changed. Please see :meth:`cssutils.css.Property.validate` for details. E.g. valid properties in the current profile are only reported on DEBUG and not INFO level anymore. The log output has been changed too, context information is provided now (line, column and name of the relevant property)
+    + **BUGFIX**: New version of encutils (0.9)
 
-    + **BUGFIX**: ``p.valid == False`` is now set for Properties not valid in the current profile even if they are valid in a different profile
-    + **BUGFIX**: Macros used when adding a new profile to ``cssutils.profile`` were polluted with ALL macros ever defined. They now correctly use the (always used) predefined macros ``Profiles._TOKEN_MACROS`` and ``PROFILES._MACROS`` in addition to the given macros (``cssutils.profile.addProfile(self, profile, properties, macros=None)``) only. If you want to use any macros defined in other profiles you need to add these to your own macros as seen in ``macros[Profiles.CSS3_BOX]``.
-    + BUGFIX: If ``cssutils.ser.prefs.validOnly == True`` serializer incorrectly put a single ``;`` for invalid properties out until now.
-
-    - **IMPROVEMENT**: comments added by ``cssutils.resolveImports`` only use the @import rules' href and not the absolute href of the referenced sheets anymore (might have been a possible security hole when showing a full local path to a sheet in a combined but not minified sheet)
-
-    - IMPROVEMENT: IE specific `alpha` values like ``filter: alpha(opacity=80)`` are parsed and kept now.
+    + **BUGFIX**: Fixed issue #21
 
 license
 -------
 --------
 For download options see http://cthedot.de/cssutils/
 
-cssutils needs Python 2.4 or higher (tested with Python 2.6.1, 2.5.2 and 2.4.4 on Vista only)
+cssutils needs Python 2.4 or higher (tested with Python 2.6.2, 2.5.2 and 2.4.4 on Vista only)
 
 
 Bug reports (via Google code), comments, etc are very much appreciated! Thanks.

File CHANGELOG.txt

 0.9.6
 -----
 
-0.9.6a3 09042x
+HEAD
 
-HEAD
+
+0.9.6a3 090426
     - **IMPROVEMENT**: Fixed ``CSSStyleDeclaration.length`` for Python 2.6.2 (due to a backport from Python 2.7 to 2.6.2 the reversed() iterator has no __length__ anymore which cssutils was using)
 
     + **BUGFIX**: New version of encutils (0.9) with these fixes:
 
 
 if 1:
-    P1 = {
-        'x': '({num}{w}){1,2}',
-        }
-    cssutils.profile.addProfile('test', P1)
-    sheet = cssutils.parseString('x { x: 1 1 }')
-    print sheet.cssRules[0].style.getProperties()[0]
+    import encutils, httplib, StringIO
+    def _fakeRes(content):
+        "build a fake HTTP response"
+        class FakeRes:
+            def __init__(self, content):
+                fp = StringIO.StringIO(content)
+                self._info = httplib.HTTPMessage(fp)
+                
+            def info(self):
+                return self._info
+        return FakeRes(content)
+    
+    res = encutils.getEncodingInfo(_fakeRes('''Content-Type: text/css;'''), 
+                                     '''Content-Type: text/css;''')
+    print (res.encoding, res.mismatch)
+    sys.exit(0)
 
+if 1:
+    import cssutils, pprint
+    # remove ALL predefined property profiles 
+    cssutils.profile.removeProfile(all=True)
+    
+    # add your custom profile, {num} is defined in Profile and always available
+    macros = {'myvalue': 'a|b|c'}
+    props = {'abc': '{myvalue}|{num}', 'color': 'red|blue'}
+    cssutils.profile.addProfile('my-profile', props, macros)
+    
+    # keep only valid properties (valid in given profile)
+    cssutils.ser.prefs.validOnly = True
+    
+    print cssutils.parseString('''a { 
+        color: green; 
+        color: red; 
+        abc: 1; 
+        abc: b;
+        abc: 1 a 
+    }''').cssText
+    
+#    import cssutils, pprint
+#    print "TOKEN_MACROS"
+#    pprint.pprint(cssutils.profile._TOKEN_MACROS)
+#    print "MACROS"
+#    pprint.pprint(cssutils.profile._MACROS)
+
+    from cssutils.profiles import macros as predef
+    from cssutils import profile
+    macros = {'my-font': predef[profile.CSS_LEVEL_2]['family-name'],
+              'identifier': predef[profile.CSS_LEVEL_2]['identifier']}
+    props = {'f': '{my-font}'}
+    cssutils.profile.addProfile('my-font-profile', props, macros)
+    print cssutils.parseString('''a { 
+        f: 1; /* 1 is invalid! */
+        f: Arial; 
+    }''').cssText
+    
     sys.exit(0)
 
 if 1: