From: aurium Date: Tue, 14 Apr 2009 22:36:11 +0000 (+0000) Subject: render_alphabetsoup now can be used as a module and is a more testable code X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0a9a89b19efbae8668da855952d2be512bd09539;p=inkscape.git render_alphabetsoup now can be used as a module and is a more testable code --- diff --git a/share/extensions/render_alphabetsoup.py b/share/extensions/render_alphabetsoup.py index f741eaa57..6bc38459b 100644 --- a/share/extensions/render_alphabetsoup.py +++ b/share/extensions/render_alphabetsoup.py @@ -39,7 +39,11 @@ font = render_alphabetsoup_config.font # Loads a super-path from a given SVG file def loadPath( svgPath ): - extensionDir = os.path.normpath(os.path.join(os.getcwd(),os.path.dirname(sys.argv[0]))) + extensionDir = os.path.normpath( + os.path.join( os.getcwd(), os.path.dirname(__file__) ) + ) + # __file__ is better then sys.argv[0] because this file may be a module + # for another one. tree = inkex.etree.parse( extensionDir + "/" + svgPath ) root = tree.getroot() pathElement = root.find('{http://www.w3.org/2000/svg}path')