summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEitan Isaacson <eitan@monotonous.org>2011-08-31 15:37:43 -0700
committerEitan Isaacson <eitan@monotonous.org>2011-08-31 15:39:48 -0700
commitbc210ec7615bd7c67bfe5b04f16a0089542e0edc (patch)
treed7c14612006fcdec35f23633d3932ae88e6da2e3
parent5c0c73b7ccc781c4e8321915e8baaf845a560a9d (diff)
downloadcaribou-bc210ec7615bd7c67bfe5b04f16a0089542e0edc.tar.gz
Fix GIRs affected with bgo#657860.
-rwxr-xr-xtools/fix_gir.py20
1 files changed, 5 insertions, 15 deletions
diff --git a/tools/fix_gir.py b/tools/fix_gir.py
index 3e08489..30bd878 100755
--- a/tools/fix_gir.py
+++ b/tools/fix_gir.py
@@ -22,7 +22,9 @@ def find_ancestor(node, name):
return find_ancestor(parent, name)
def fix_vfuncs(dom):
- for f in dom.getElementsByTagName("callback"):
+ for f in dom.getElementsByTagName("field"):
+ callbacks = f.getElementsByTagName("callback")
+
record = find_ancestor(f, "record")
if not record:
continue
@@ -33,20 +35,8 @@ def fix_vfuncs(dom):
assert(name.endswith("Class") or name.endswith("Iface"))
assert(cname.endswith("Class") or name.endswith("Iface"))
- params = (f.getElementsByTagName("parameters") or [None])[0]
-
- if not params:
- params = dom.createElement("parameters")
- f.insertBefore(params, f.firstChild)
-
- param = dom.createElement("parameter")
- param.setAttribute("name", "self")
- param.setAttribute("transfer-ownership", "none")
- ptype = dom.createElement("type")
- ptype.setAttribute("name", name[:-5])
- ptype.setAttribute("c:type", cname[:-5])
- param.appendChild(ptype)
- params.insertBefore(param, params.firstChild)
+ if len(callbacks) == 2:
+ callbacks[-1].parentNode.removeChild(callbacks[-1])
if __name__ == "__main__":
import sys