Commits

Manfred Moitzi committed e2dfcfe

prevent setup.py from compiling all modules; fixed Python3.3 testing error;

Comments (0)

Files changed (5)

 
 NEWS
 ====
+Version 1.1.2 - 08 Januar 2013
+
+  * prevent setup.py from compiling all modules - error with 'pyparsing_py2.py' and Python3
 
 Version 1.1.1 - 15 August 2012
 
 
 If you are looking for a SVG Documentation beyond the official W3C papers, go
 to O'Reilly commons: http://commons.oreilly.com/wiki/index.php/SVG_Essentials,
- or (german) http://www.selfsvg.info .
+or (german) http://www.selfsvg.info .
 
 Contents
 --------
 # Copyright (C) 2010-2012  Manfred Moitzi
 
 
-import os
+import os, sys
 from distutils.core import setup
 
 from svgwrite import VERSION, AUTHOR_NAME, AUTHOR_EMAIL
     except IOError:
         return "File '%s' not found.\n" % fname
 
+# do not compile modules
+# contains modules with Python2 and Python3 Syntax:
+# data/pyparsing_py2.py
+# data/pyparsing_py3.py
+sys.argv.append('--no-compile')
+
 setup(name='svgwrite',
     version=VERSION,
     description='A Python library to create SVG drawings.',

svgwrite/__init__.py

 
 """
 
-version = (1, 1, 1)
+version = (1, 1, 2)
 VERSION = '%d.%d.%d' % version
 
 AUTHOR_NAME = 'Manfred Moitzi'

svgwrite/data/types.py

     def __init__(self, attributes):
         self.name = None
         self._attributes = {}
-        firstkey = None
 
         for names, attribute in attributes.items():
             for name in names.split():
                 elif self.name != attribute.name:
                     raise ValueError("Different attribute-names for SVGMultiAttribute "\
                                      "(%s != %s)." % (self.name, attribute.name))
-                if not firstkey:
-                    firstkey = name
 
-
-        if '*' not in self._attributes:
+        if '*' not in self._attributes and len(self._attributes):
             # if no default attribute definition were given
             # set the first attribute definition as the default attribute definition
+            firstkey = sorted(self._attributes.keys())[0]
             self._attributes['*'] = self._attributes[firstkey]
 
     def get_attribute(self, elementname):