aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-10-26 21:46:22 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2015-10-26 21:46:22 +0200
commit8b1128a93bf79f6fe91f86e0bed6d0a46f9a32c2 (patch)
tree8710e0dffd2710e4c563289a5fe953d4bd78d511
parenta16463972dbbc7c944dbbfbee57ade758e3077da (diff)
downloadmeson-8b1128a93bf79f6fe91f86e0bed6d0a46f9a32c2.zip
meson-8b1128a93bf79f6fe91f86e0bed6d0a46f9a32c2.tar.gz
meson-8b1128a93bf79f6fe91f86e0bed6d0a46f9a32c2.tar.bz2
Resource can be either a string or a File.
-rw-r--r--modules/gnome.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/gnome.py b/modules/gnome.py
index f5537a4..104c190 100644
--- a/modules/gnome.py
+++ b/modules/gnome.py
@@ -21,6 +21,7 @@ import subprocess
from coredata import MesonException
import mlog
import xml.etree.ElementTree as ET
+from mesonlib import File
girwarning_printed = False
@@ -46,10 +47,16 @@ class GnomeModule:
target_h = build.CustomTarget(args[0] + '_h', state.subdir, kwargs)
return [target_c, target_h]
- def parse_gresource_xml(self, state, fname):
+ def parse_gresource_xml(self, state, fobj):
+ if isinstance(fobj, File):
+ fname = fobj.fname
+ subdir = fobj.subdir
+ else:
+ fname = fobj
+ subdir = state.subdir
abspath = os.path.join(state.environment.source_dir, state.subdir, fname)
relative_part = os.path.split(fname)[0]
- resdir = os.path.join(state.subdir, 'data')
+ resdir = os.path.join(subdir, 'data')
try:
tree = ET.parse(abspath)
root = tree.getroot()