[caribou] Fix GIRs affected with bgo#657860.
- From: Eitan Isaacson <eitani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [caribou] Fix GIRs affected with bgo#657860.
- Date: Wed, 31 Aug 2011 22:39:16 +0000 (UTC)
commit bc210ec7615bd7c67bfe5b04f16a0089542e0edc
Author: Eitan Isaacson <eitan monotonous org>
Date: Wed Aug 31 15:37:43 2011 -0700
Fix GIRs affected with bgo#657860.
tools/fix_gir.py | 20 +++++---------------
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]