-
Notifications
You must be signed in to change notification settings - Fork 144
Closed
Labels
Description
Plotting a single layer fails if layer name contains unicode characters.
For example, try plotting layer 3 from this file: http://www.thingiverse.com/download:1219530
Traceback (most recent call last):
File "eggbot.py", line 1154, in <module>
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 268, in affect
self.effect()
File "eggbot.py", line 220, in effect
self.plotToEggBot()
File "eggbot.py", line 440, in plotToEggBot
self.recursivelyTraverseSvg( self.svg, self.svgTransform )
File "eggbot.py", line 499, in recursivelyTraverseSvg
self.DoWePlotLayer( node.get( inkex.addNS( 'label', 'inkscape' ) ) )
File "eggbot.py", line 898, in DoWePlotLayer
if str.isdigit( CurrentLayerName[:stringPos] ):
TypeError: descriptor 'isdigit' requires a 'str' object but received a 'unicode'
Easy fix:
diff --git a/inkscape_driver/eggbot.py b/inkscape_driver/eggbot.py
index b209b29..d24fa0b 100755
--- a/inkscape_driver/eggbot.py
+++ b/inkscape_driver/eggbot.py
@@ -884,7 +884,7 @@ class EggBot( inkex.Effect ):
TempNumString = 'x'
stringPos = 1
- CurrentLayerName = string.lstrip( strLayerName ) #remove leading whitespace
+ CurrentLayerName = string.lstrip( strLayerName.encode( 'ascii', 'ignore' ) ) #remove leading whitespace
# Look at layer name. Sample first character, then first two, and
# so on, until the string ends or the string no longer consists of