From 0a9a89b19efbae8668da855952d2be512bd09539 Mon Sep 17 00:00:00 2001 From: aurium Date: Tue, 14 Apr 2009 22:36:11 +0000 Subject: [PATCH] render_alphabetsoup now can be used as a module and is a more testable code --- share/extensions/render_alphabetsoup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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') -- 2.30.2