• R/O
  • HTTP
  • SSH
  • HTTPS

htmltree: 提交

メインリポジトリ


Commit MetaInfo

修订版e4c9dc3b1c91764a5ea2c86b9d2c518e4bc9dcc3 (tree)
时间2011-07-13 21:13:29
作者Hiromichi MATSUSHIMA <hirom@offi...>
CommiterHiromichi MATSUSHIMA

Log Message

implement HTMLElement.delete, but buggy...

更改概述

差异

--- a/htmltree.py
+++ b/htmltree.py
@@ -179,6 +179,10 @@ class HTMLElement(list):
179179 parent = elem.parent()
180180 parent.remove(elem)
181181
182+ def delete(self):
183+ p = self.parent()
184+ p.remove(self)
185+
182186 # query functions
183187 # TODO: this function is under implementing...
184188 def select(self, expr):
--- a/test/test_base.py
+++ b/test/test_base.py
@@ -39,3 +39,7 @@ print t.inner_html()
3939
4040 r.remove_element(t)
4141 print r.inner_html()
42+
43+t = r.select_1st("#htmltree")
44+t.delete()
45+print r.inner_html()
Show on old repository browser