[elbe-devel] [PATCH v5 2/5] treeutils: add get_parent
Akash Satamkar
akash at linutronix.de
Mon Sep 23 16:16:13 CEST 2019
Add get_parent method in class elem.
It will return an elem of getparent().
Signed-off-by: Akash Satamkar <akash at linutronix.de>
---
elbepack/treeutils.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/elbepack/treeutils.py b/elbepack/treeutils.py
index b1ac3711..16308a42 100644
--- a/elbepack/treeutils.py
+++ b/elbepack/treeutils.py
@@ -113,6 +113,9 @@ class elem(ebase):
elif attr in ['false', '0']:
return False
+ def get_parent(self):
+ return elem(self.et.getparent())
+
class etree(ebase):
def __init__(self, fname):
--
2.20.1
More information about the elbe-devel
mailing list