Loading tools/adbs +0 −2 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function import os import os.path import re Loading tools/check_radio_versions.py +9 −13 Original line number Diff line number Diff line Loading @@ -14,9 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function import sys import os try: from hashlib import sha1 Loading Loading @@ -53,9 +52,8 @@ for item in sys.argv[2:]: try: f = open(fn + ".sha1") except IOError: if not bad: print() print("*** Error opening \"%s.sha1\"; can't verify %s" % (fn, key)) if not bad: print print "*** Error opening \"%s.sha1\"; can't verify %s" % (fn, key) bad = True continue for line in f: Loading @@ -65,19 +63,17 @@ for item in sys.argv[2:]: versions[h] = v if digest not in versions: if not bad: print() print("*** SHA-1 hash of \"%s\" doesn't appear in \"%s.sha1\"" % (fn, fn)) if not bad: print print "*** SHA-1 hash of \"%s\" doesn't appear in \"%s.sha1\"" % (fn, fn) bad = True continue if versions[digest] not in values: if not bad: print() print("*** \"%s\" is version %s; not any %s allowed by \"%s\"." % ( fn, versions[digest], key, sys.argv[1])) if not bad: print print "*** \"%s\" is version %s; not any %s allowed by \"%s\"." % ( fn, versions[digest], key, sys.argv[1]) bad = True if bad: print() print sys.exit(1) tools/compare_fileslist.py +3 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ from __future__ import print_function import cgi, os, sys import cgi, os, string, sys def iteritems(obj): Loading @@ -42,10 +42,10 @@ def main(argv): data = {} index = 0 for input in inputs: f = open(input) f = file(input, "r") lines = f.readlines() f.close() lines = [l.strip() for l in lines] lines = map(string.split, lines) lines = [(x_y[1],int(x_y[0])) for x_y in lines] for fn,sz in lines: if fn not in data: Loading tools/diff_package_overlays.py +2 −4 Original line number Diff line number Diff line Loading @@ -34,13 +34,11 @@ Format of current_overlays.txt and previous_overlays.txt: ... """ from __future__ import print_function import sys def main(argv): if len(argv) != 4: print(sys.stderr, __doc__) print >> sys.stderr, __doc__ sys.exit(1) f = open(argv[1]) Loading Loading @@ -87,7 +85,7 @@ def main(argv): # Print out the package names that have overlay change. for r in result: print(r) print r if __name__ == "__main__": main(sys.argv) tools/event_log_tags.py +4 −6 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ """A module for reading and parsing event-log-tags files.""" from __future__ import print_function import re import sys Loading Loading @@ -57,7 +55,7 @@ class TagFile(object): if file_object is None: try: file_object = open(filename, "rb") except (IOError, OSError) as e: except (IOError, OSError), e: self.AddError(str(e)) return Loading Loading @@ -102,7 +100,7 @@ class TagFile(object): self.tags.append(Tag(tag, tagname, description, self.filename, self.linenum)) except (IOError, OSError) as e: except (IOError, OSError), e: self.AddError(str(e)) Loading Loading @@ -132,6 +130,6 @@ def WriteOutput(output_file, data): out = open(output_file, "wb") out.write(data) out.close() except (IOError, OSError) as e: print("failed to write %s: %s" % (output_file, e), file=sys.stderr) except (IOError, OSError), e: print >> sys.stderr, "failed to write %s: %s" % (output_file, e) sys.exit(1) Loading
tools/adbs +0 −2 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function import os import os.path import re Loading
tools/check_radio_versions.py +9 −13 Original line number Diff line number Diff line Loading @@ -14,9 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function import sys import os try: from hashlib import sha1 Loading Loading @@ -53,9 +52,8 @@ for item in sys.argv[2:]: try: f = open(fn + ".sha1") except IOError: if not bad: print() print("*** Error opening \"%s.sha1\"; can't verify %s" % (fn, key)) if not bad: print print "*** Error opening \"%s.sha1\"; can't verify %s" % (fn, key) bad = True continue for line in f: Loading @@ -65,19 +63,17 @@ for item in sys.argv[2:]: versions[h] = v if digest not in versions: if not bad: print() print("*** SHA-1 hash of \"%s\" doesn't appear in \"%s.sha1\"" % (fn, fn)) if not bad: print print "*** SHA-1 hash of \"%s\" doesn't appear in \"%s.sha1\"" % (fn, fn) bad = True continue if versions[digest] not in values: if not bad: print() print("*** \"%s\" is version %s; not any %s allowed by \"%s\"." % ( fn, versions[digest], key, sys.argv[1])) if not bad: print print "*** \"%s\" is version %s; not any %s allowed by \"%s\"." % ( fn, versions[digest], key, sys.argv[1]) bad = True if bad: print() print sys.exit(1)
tools/compare_fileslist.py +3 −3 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ from __future__ import print_function import cgi, os, sys import cgi, os, string, sys def iteritems(obj): Loading @@ -42,10 +42,10 @@ def main(argv): data = {} index = 0 for input in inputs: f = open(input) f = file(input, "r") lines = f.readlines() f.close() lines = [l.strip() for l in lines] lines = map(string.split, lines) lines = [(x_y[1],int(x_y[0])) for x_y in lines] for fn,sz in lines: if fn not in data: Loading
tools/diff_package_overlays.py +2 −4 Original line number Diff line number Diff line Loading @@ -34,13 +34,11 @@ Format of current_overlays.txt and previous_overlays.txt: ... """ from __future__ import print_function import sys def main(argv): if len(argv) != 4: print(sys.stderr, __doc__) print >> sys.stderr, __doc__ sys.exit(1) f = open(argv[1]) Loading Loading @@ -87,7 +85,7 @@ def main(argv): # Print out the package names that have overlay change. for r in result: print(r) print r if __name__ == "__main__": main(sys.argv)
tools/event_log_tags.py +4 −6 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ """A module for reading and parsing event-log-tags files.""" from __future__ import print_function import re import sys Loading Loading @@ -57,7 +55,7 @@ class TagFile(object): if file_object is None: try: file_object = open(filename, "rb") except (IOError, OSError) as e: except (IOError, OSError), e: self.AddError(str(e)) return Loading Loading @@ -102,7 +100,7 @@ class TagFile(object): self.tags.append(Tag(tag, tagname, description, self.filename, self.linenum)) except (IOError, OSError) as e: except (IOError, OSError), e: self.AddError(str(e)) Loading Loading @@ -132,6 +130,6 @@ def WriteOutput(output_file, data): out = open(output_file, "wb") out.write(data) out.close() except (IOError, OSError) as e: print("failed to write %s: %s" % (output_file, e), file=sys.stderr) except (IOError, OSError), e: print >> sys.stderr, "failed to write %s: %s" % (output_file, e) sys.exit(1)