xcession
unread,May 3, 2009, 1:56:21 PM5/3/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cssutils
I'm investigating google app engine for a little css-related project,
but am having trouble doing the simplest things and I'm stumped as to
why.
I've gone through the Guestbook example and have modified it only a
little thus:
<snip>
import os
import codecs
import cssutils
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
def get(self):
css = '''
body {
color: blue;
font: normal 100% sans-serif;
}
p {
color: green;
font-size: 2em;
}
.x {
color: black;
}
'''
sheet = cssutils.parseString(css)
</snip>
But when I run it, i'm getting the errors:
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\ext
\webapp\__init__.py", line 501, in __call__
handler.get(*groups)
File "c:\test\helloworld.py", line 31, in get
sheet = cssutils.parseString(css)
File "c:\test\cssutils\__init__.py", line 150, in parseString
return CSSParser().parseString(*a, **k)
File "c:\test\cssutils\parse.py", line 95, in parseString
cssText = codecs.getdecoder('css')(cssText, encoding=encoding)[0]
File "C:\test\cssutils\codec.py", line 200, in decode
if _encoding == "css":
TypeError: 'NoneType' object is not callable
I'm on windows, python 2.5, cssutils-0.9.6a3. I've had to copy the
cssutils and encutils folder from site-packages into my c:\test
folder, as per google app engine instructions.
If I remove all the app-engine specifics, basically ending up with
just the imports and a "main()" function in the file, then run it on
its own with python, it works fine.
I'm a python noob anyway, so this could be something embarrassingly
simple, but if so I can't see it!
Hope you can help