diff options
| author | Aur??lio A. Heckert <aurium@gmail.com> | 2009-10-02 14:42:58 +0000 |
|---|---|---|
| committer | aurium <aurium@users.sourceforge.net> | 2009-10-02 14:42:58 +0000 |
| commit | c0d79bb094e8586129a6e0ae2fb0cd4ab8fde64e (patch) | |
| tree | 1fdc510701a3e95efc65ada5e6a7d317ce4ab4c8 | |
| parent | Calligraphy tutorials update (SVG). See Bug #440492 (tutorial-calligraphy: So... (diff) | |
| download | inkscape-c0d79bb094e8586129a6e0ae2fb0cd4ab8fde64e.tar.gz inkscape-c0d79bb094e8586129a6e0ae2fb0cd4ab8fde64e.zip | |
more friendly usage for simplestyle: no more test for style attribute or type conversion on user code.
(bzr r8694)
| -rwxr-xr-x | share/extensions/simplestyle.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/share/extensions/simplestyle.py b/share/extensions/simplestyle.py index 4dcfd1aba..e312d3cef 100755 --- a/share/extensions/simplestyle.py +++ b/share/extensions/simplestyle.py @@ -173,10 +173,13 @@ svgcolors={ def parseStyle(s): """Create a dictionary from the value of an inline style attribute""" - return dict([i.split(":") for i in s.split(";") if len(i)]) + if s is None: + return {} + else: + return dict([i.split(":") for i in s.split(";") if len(i)]) def formatStyle(a): """Format an inline style attribute from a dictionary""" - return ";".join([":".join(i) for i in a.iteritems()]) + return ";".join([att+":"+str(val) for att,val in a.iteritems()]) def isColor(c): """Determine if its a color we can use. If not, leave it unchanged.""" if c.startswith('#') and (len(c)==4 or len(c)==7): |
