Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1810)

Unified Diff: Tools/Scripts/webkitpy/w3c/test_converter.py

Issue 16171009: switch import-w3c-tests from using print statements to logging (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: clean up paths a bit Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/webkitpy/w3c/test_converter.py
diff --git a/Tools/Scripts/webkitpy/w3c/test_converter.py b/Tools/Scripts/webkitpy/w3c/test_converter.py
index 9d9578865c308a67efed406d7975e56438924280..1b029b8ab282aae37277e437e6340c1db5c9fec7 100644
--- a/Tools/Scripts/webkitpy/w3c/test_converter.py
+++ b/Tools/Scripts/webkitpy/w3c/test_converter.py
@@ -27,12 +27,16 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
+import logging
import re
from webkitpy.common.host import Host
from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, Tag
+_log = logging.getLogger(__name__)
+
+
class W3CTestConverter(object):
def __init__(self):
@@ -108,10 +112,10 @@ class W3CTestConverter(object):
if tag.name != 'script':
attr = 'href'
- if not attr in tag:
+ if not attr in tag.attrMap:
# FIXME: Figure out what to do w/ invalid tags. For now, we return False
# and leave the document unmodified, which means that it'll probably fail to run.
- print "Error: missing an attr in %s" % filename
+ _log.error("Missing an attr in %s" % filename)
return False
old_path = tag[attr]
@@ -176,7 +180,7 @@ class W3CTestConverter(object):
# or at the beginning of the string (for inline style attribute)
pattern = '([\s{]|^)' + unprefixed_property + '(\s+:|:)'
if re.search(pattern, text):
- print 'converting %s -> %s' % (unprefixed_property, prefixed_property)
+ _log.info('converting %s -> %s' % (unprefixed_property, prefixed_property))
converted_properties.append(prefixed_property)
text = re.sub(pattern, prefixed_property + ':', text)
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/w3c/test_converter_unittest.py » ('j') | Tools/Scripts/webkitpy/w3c/test_importer.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698