[gimp] Use the proper API to locate the user gimp directory



commit 61c065d2446e2955515f183276d43a0e4b83e884
Author: Sven Neumann <s neumann raumfeld com>
Date:   Fri May 8 16:15:47 2009 +0200

    Use the proper API to locate the user gimp directory
---
 plug-ins/pygimp/plug-ins/text-brush.py |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/plug-ins/pygimp/plug-ins/text-brush.py b/plug-ins/pygimp/plug-ins/text-brush.py
index 0d3c633..0f8adf2 100755
--- a/plug-ins/pygimp/plug-ins/text-brush.py
+++ b/plug-ins/pygimp/plug-ins/text-brush.py
@@ -22,9 +22,6 @@ import os
 
 gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
 
-gimp_dir = ".gimp-%d.%d" %(gimp.version[:2])
-BRUSH_DIR = os.path.join(os.path.expanduser('~'),gimp_dir,'brushes')
-    
 def text_brush(font_name, font_size, text):
     pdb.gimp_context_push()
     pdb.gimp_context_set_default_colors()
@@ -54,8 +51,8 @@ def text_brush(font_name, font_size, text):
                                   False,0 ,0)
             pdb.gimp_floating_sel_anchor(text_floating_sel)
 
-    file_name = (text.lower().replace(" ", "_") + ".gih").encode("utf-8")
-    file_path = os.path.join(BRUSH_DIR, file_name)
+    file_name = text.lower().replace(" ", "_") + ".gih"
+    file_path = os.path.join(gimp.directory, 'brushes', file_name)
     
     pdb.file_gih_save(img, img.layers[0], 
                       file_path, file_path, 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]