[gimp-help-2] tools: search images relatively to the source directory.



commit 9212c308ba45760ded5d63f49f6e0e9fb52a85f6
Author: Jehan <jehan girinstud io>
Date:   Sun Jun 11 22:39:38 2017 +0200

    tools: search images relatively to the source directory.
    
    Otherwise a VPATH build will never find the images.

 tools/xml2po/modes/gimphelp.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/tools/xml2po/modes/gimphelp.py b/tools/xml2po/modes/gimphelp.py
index 4fa51ee..f066228 100644
--- a/tools/xml2po/modes/gimphelp.py
+++ b/tools/xml2po/modes/gimphelp.py
@@ -61,6 +61,9 @@ class gimphelpXmlMode(docbookXmlMode):
                 origimagepath = attr
                 for subdir in ("C", "commmon"):
                     imagepath = origimagepath.replace("/", "/%s/" % subdir, 1)
+                    # I need to search files relatively to the source directory.
+                    scriptdir = os.path.dirname(os.path.realpath(__file__))
+                    imagepath = os.path.join(scriptdir, '../../../', imagepath)
                     if os.path.exists(imagepath):
                         hash = self._md5_for_file(imagepath)
                         break


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