summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2015-06-04 11:45:24 -0700
committerPhilip Chimento <philip@endlessm.com>2015-06-04 14:28:17 -0700
commitdef18b63d07a570ec5732a36f2eaabc6b10b14d5 (patch)
tree64f311950f8af8d6423762e5885c8aae94c0cfa5 /tools
parent9b628605064811bbfd2faf72e07899d8c37fe15c (diff)
Avoid unnecessary imports
We don't need to import all of os, just os.path; and urllib was not necessary for reading the file. [endlessm/eos-sdk#3245]
Diffstat (limited to 'tools')
-rwxr-xr-xtools/eos-html-extractor6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/eos-html-extractor b/tools/eos-html-extractor
index 64800c9..23802dc 100755
--- a/tools/eos-html-extractor
+++ b/tools/eos-html-extractor
@@ -3,9 +3,8 @@
# Copyright 2013-2015 Endless Mobile, Inc.
import argparse
-import os
+import os.path
import re
-import urllib
from bs4 import BeautifulSoup
from HTMLParser import HTMLParser
@@ -47,7 +46,8 @@ top_dir = args.top_srcdir
final_path = os.path.relpath(html_file, top_dir)
# Create the BeautifulSoup HTML-parsing object
-page = urllib.urlopen(urllib.pathname2url(html_file)).read()
+with open(html_file) as f:
+ page = f.read()
soup = BeautifulSoup(page)
# Extract all translatable strings from that HTML