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

Unverified Commit 11423014 authored by Anthony King's avatar Anthony King Committed by Michael Bestas
Browse files

py3: java-event-log-tags

Change-Id: I0bf4cbe990c21b6d57e54e96ea62c56ca2d41b86
parent caaaedf2
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -23,37 +23,43 @@ tags in the given input file.
-h to display this usage message and exit.
"""

import cStringIO
from __future__ import print_function

import getopt
import os
import os.path
import re
import sys

try:
  from cStringIO import StringIO
except ImportError:
  from io import StringIO

import event_log_tags

output_file = None

try:
  opts, args = getopt.getopt(sys.argv[1:], "ho:")
except getopt.GetoptError, err:
  print str(err)
  print __doc__
except getopt.GetoptError as err:
  print(str(err))
  print(__doc__)
  sys.exit(2)

for o, a in opts:
  if o == "-h":
    print __doc__
    print(__doc__)
    sys.exit(2)
  elif o == "-o":
    output_file = a
  else:
    print >> sys.stderr, "unhandled option %s" % (o,)
    print("unhandled option %s" % o, file=sys.stderr)
    sys.exit(1)

if len(args) != 2:
  print "need exactly two input files, not %d" % (len(args),)
  print __doc__
  print("need exactly two input files, not %d" % len(args))
  print(__doc__)
  sys.exit(1)

fn = args[0]
@@ -85,10 +91,10 @@ if "javadoc_hide" in tagfile.options:

if tagfile.errors:
  for fn, ln, msg in tagfile.errors:
    print >> sys.stderr, "%s:%d: error: %s" % (fn, ln, msg)
    print("%s:%d: error: %s" % (fn, ln, msg), file=sys.stderr)
  sys.exit(1)

buffer = cStringIO.StringIO()
buffer = StringIO()
buffer.write("/* This file is auto-generated.  DO NOT MODIFY.\n"
             " * Source file: %s\n"
             " */\n\n" % (fn,))