Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ef7a5c7 authored by Steve Kondik's avatar Steve Kondik
Browse files

Revert "py3: update all the things"

This reverts commit 6cb0e681.
parent c400f2f8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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
+9 −13
Original line number Diff line number Diff line
@@ -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
@@ -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:
@@ -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)
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@

from __future__ import print_function

import cgi, os, sys
import cgi, os, string, sys


def iteritems(obj):
@@ -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:
+2 −4
Original line number Diff line number Diff line
@@ -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])
@@ -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)
+4 −6
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@

"""A module for reading and parsing event-log-tags files."""

from __future__ import print_function

import re
import sys

@@ -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

@@ -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))


@@ -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