scripts:Correctly parse offline spec w/ Soup
authorTobin Ehlis <tobine@google.com>
Fri, 19 May 2017 14:24:04 +0000 (08:24 -0600)
committerTobin Ehlis <tobine@google.com>
Fri, 19 May 2017 17:29:29 +0000 (11:29 -0600)
layers/spec.py

index 8c1831f..5ed7d49 100644 (file)
@@ -110,7 +110,8 @@ class Specification:
             self.soup = BeautifulSoup(urllib2.urlopen(spec_url), 'html.parser')
         else:
             print ("Making soup from local spec %s, this will take a minute" % (spec_file))
-            self.soup = BeautifulSoup(spec_file, 'html.parser')
+            with open(spec_file, "r") as sf:
+                self.soup = BeautifulSoup(sf, 'html.parser')
         self.parseSoup()
         #print(self.soup.prettify())
     def updateDict(self, updated_dict):