see whatever…

jump to menu

June 24, 2007

cssutils 0.9.2a5

Filed under: cssutils — see @ 5:42 pm

Today I released even a new version of cssutils. I know that these are now 3 releases in a week (at least 1 of them almost unusable ;) ) but I think release early, release often is not that bad an idea.

This release includes a better handling of incomplete stylesheets. A CSS parser is expected to actually close any open blocks, strings etc and even keep the rules if they are then valid. I do not think this is actually a very good idea and also thought that this would be almost impossible to implement (at least with my meager knowledge). But actually it was very easy. When parsing a complete stylesheet which is the same as setting CSSStyleSheet.cssText I add a “EOF” token to the resulting token list. So each rule checks the EOF token and closes itself if needed.

This does only happen in case of CSSStyleSheet so setting cssText on single rules or other objects does not handle open blocks etc but does raise a SyntaxError instead. I guess this should be according to the spec at least as far as I understand it.

I hope I can finish 0.9.2 this month or so but I have quite a few things a work to do so it may have to wait a few weeks longer. Probably the most missing things in the lib currently are the nonexistant CSSValue and subclasses implementations (which I started but are far from complete) and the missing Media Queries which are not even a recommendation yet but are in use at least for HTML stylesheets. I guess this has almost highest priority as stylesheets using this feature are simple stripped of the rules defined here if run through the parser. I guess otherwise the whole lib is now far more than I expected (more than 3 years ago ;) )…

June 20, 2007

cssutils dist again… (0.9.2a3 -> 0.9.2a4)

Filed under: cssutils — see @ 10:24 pm

Aaargh, somehow I managed to make the dist files as they should but removed the most important lines from the setup.py for cssutils which actually say where to find the actual packages. So 0.9.2a3 was nice but did not install anything :( (the egg was fine though).

So I put 0.9.2a4 online which have the needed two lines in setup.py:

package_dir={'':'src'}
packages=find_packages('src')

    Nothing else has changed, apart from the version which should now correctly give: import cssutils;print cssutils.__version__; -> 0.9.2a4 …

    Deeply sorry for all the inconvinience caused…

    June 18, 2007

    cssutils ongoings

    Filed under: cssutils — see @ 10:12 pm

    After moving the source code of cssutils to Google Code I did quite a few other changes as well.

    I did start the implementation of CSSValue and subclasses (far from done though) and also implemented parts of CSS2Properties (setting does only set the given property and not related ones yet, e.g. setting margin: 5px only sets margin but not marginTop etc). I also found quite a few bugs firstly from the first issue reported on Google Code (the actual issue I could not reproduce though) and secondly while trying the CSS stylesheet of XHTML 2 which is a bit of a mess actually as it does not validate at all (well, it’s still not a recommendation so ok I guess).

    While working and refactoring the tokenizer quite a bit I noticed parsing speed has improved¬† for quite a bit, I guess roughly about 20%. The tokenizer did some really silly stuff like defining some rather messy dicts each time they were used. Now they are defined once and that of course helps performance…

    After being quite busy I did a new release but did not realize that somehow the dist was somehow different. Maybe as I updated setuptools, but maybe just so ;)

    Anyway there was a problem with size. 0.9.1b3 was about 1MB, 0.9.2a1 about 4 and 0.9.2a2 already 6MB?! I did an update of Epydoc which I use to generate the API docs and somehow thought that has changed. But the actual problem was much simpler. I actually included any older release files in each new release which got bigger and bigger… bugger, I only found out after looking into the dist zip.

    So I had to adjust the setuptools config which I still don’t really understand. The only thing really working is using the MANIFEST.in file. I couldn’t simple bring all other configuration in setup.py with diverse keyword options to work. But that works now and the new release a3 is slightly under 1MB of size only (the Python Egg is much smaller but that stayed about the same size all the time of course). The documentation of setuptools is not really that bad but somehow I don’t understand how it really works. Maybe there is simply too much information on the site…

    June 2, 2007

    this blog has moved…

    Filed under: Uncategorized — see @ 7:37 pm

    I moved this blog to its own domain as the traffic has gone up a bit too much and it’s getting near the limit of my old site…

    Moving has not been difficult. First I tried a manual transfer of posts, categories, comments etc as I failed to find the “export” function in WordPress – kind of embarrassing… It did work though but I though to be sure and not miss any hidden deeper problems I reset the DB and made an export from the old domain and imported the data here. So I guess it does work now as before.

    Still have to redirect the old blog to this one, should be easy though.

    BTW, I guess there won’t be a more frequent update to this blog in spite of its own domain. I just thought about moving anyway, so after some months thinking I finally just did it.

    Powered by WordPress