Commits

Ed Brannin committed 64977ce

Starting to refactor and add tests.

Comments (0)

Files changed (3)

 glob:.*.swp
+glob:*.pyc
 glob:*~
       s.replaceWith(NavigableString(s.renderContents()))
   return soup
   
-print strip_spans(BeautifulSoup("""
-<div id="Oobj19" style="position:absolute; z-index:2; visibility:visible; left:359px; top:86px; width:60px; height:20px;">
-<div id="Ggeo47" class="dfltt">
-<font face="Times New Roman" class="fsx01"><B><I><a href="about.html" title="ABOUT">ABOUT</a><br></I></B></font></div>
-</div>
-""")).prettify()
 
-raise Exception("hi")
+if __name__ == '__main__':
+  try:
+    path = sys.argv[1]
+  except IndexError:
+    path = "../current-site/www.holyname-greece.org/"
 
-try:
-  path = sys.argv[1]
-except IndexError:
-  path = "../current-site/www.holyname-greece.org/"
+  for root, dirs, files in os.walk(path):
+    for f in files:
+      if 'htm' in f:
+        handle(os.path.join(root, f))
 
-for root, dirs, files in os.walk(path):
-  for f in files:
-    if 'htm' in f:
-      handle(os.path.join(root, f))
-
+from soupify import *
+
+def test_strip_spans():
+  soup = BeautifulSoup("""
+  <div id="Oobj19" style="position:absolute; z-index:2; visibility:visible; left:359px; top:86px; width:60px; height:20px;">
+  <div id="Ggeo47" class="dfltt">
+  <font face="Times New Roman" class="fsx01"><B><I><a href="about.html" title="ABOUT">ABOUT</a><br></I></B></font></div>
+  </div>
+  """)
+ print strip_spans(soup).prettify()