summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAnthony King <anthonydking@slimroms.net>2015-10-31 15:06:38 -0400
committerTom Powell <zifnab@zifnab06.net>2016-01-04 10:53:44 -0800
commit74dcc715d5bcae00dde9c9615f157f654e623408 (patch)
treeb810c01d7a796f6ae699563739cbf28cba5adb98 /tools
parent48e4d3893b1015764fee71e676dc3de30dd3a64b (diff)
downloadbuild-74dcc715d5bcae00dde9c9615f157f654e623408.zip
build-74dcc715d5bcae00dde9c9615f157f654e623408.tar.gz
build-74dcc715d5bcae00dde9c9615f157f654e623408.tar.bz2
py3: product_debug
Change-Id: I4a1e25753a9addd199f148e7eec883b3d9ea337a
Diffstat (limited to 'tools')
-rwxr-xr-xtools/product_debug.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/product_debug.py b/tools/product_debug.py
index ff2657c..891587f 100755
--- a/tools/product_debug.py
+++ b/tools/product_debug.py
@@ -14,10 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import print_function
+
import os
import re
import sys
+
+def iteritems(obj):
+ if hasattr('iteritems'):
+ return obj.iteritems()
+ return obj.items()
+
+
def break_lines(key, val):
# these don't get split
if key in ("PRODUCT_MODEL"):
@@ -42,7 +51,7 @@ def parse_variables(lines):
def render_variables(variables):
variables = dict(variables)
del variables["FILE"]
- variables = list(variables.iteritems())
+ variables = list(variables.items())
variables.sort(lambda a, b: cmp(a[0], b[0]))
return ("<table id='variables'>"
+ "\n".join([ "<tr><th>%(key)s</th><td>%(val)s</td></tr>" % { "key": key, "val": val }
@@ -104,7 +113,7 @@ def main(argv):
"variables": render_variables(variables),
"original": render_original(variables, original),
})
- print """<html>
+ print("""<html>
<head>
@@ -153,7 +162,7 @@ def main(argv):
%(variables)s
</body>
</html>
-""" % values
+""" % values)
if __name__ == "__main__":
main(sys.argv)