Skip to content

Spiral Wrapped Text extension fails if text contains any markup entities #43

@Yura80

Description

@Yura80

If text contains any '&' entity, such as &, it produces the following error:

Traceback (most recent call last):
File "eggbot_spiraltext.py", line 400, in
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 268, in affect
self.effect()
File "eggbot_spiraltext.py", line 366, in effect
markup = processMarkup( self.options.text, self.options.fontfamily )
File "eggbot_spiraltext.py", line 216, in processMarkup
if entity_refs.has_key[eref]:
TypeError: 'builtin_function_or_method' object is unsubscriptable

A small patch is necessary:

diff --git a/inkscape_contributed/eggbot_spiraltext.py b/inkscape_contributed/eggbot_spiraltext.py
index d453f3a..3a0fba2 100755
--- a/inkscape_contributed/eggbot_spiraltext.py
+++ b/inkscape_contributed/eggbot_spiraltext.py
@@ -213,7 +213,7 @@ def processMarkup( text, family='sans' ):
                        j = text.find( ';', i+1 )
                        if ( j != -1 ):
                                eref = text[i:j+1]
-                               if entity_refs.has_key[eref]:
+                               if entity_refs.has_key(eref):
                                        outstr += entity_refs[eref]
                                        i = j + 1
                                else:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions