def main(argv):
  if len(argv) < 2:
    print "Usage: %s com.apple.LaunchServices.QuarantineEvents" % __program__
    sys.exit(1)

  encoding = locale.getpreferredencoding()

  if encoding.upper() != "UTF-8":
    print "%s requires an UTF-8 capable console/terminal" % __program__
    sys.exit(1)

  files_to_process = []
  for input_glob in argv[1:]:
    files_to_process += glob.glob(input_glob)

  for input_file in files_to_process:
    events = OSXQuarantineEvents(open(input_file))

    for data in events.Parse():
      timestamp, entry_type, url, data1, data2, data3, _, _, _, _, _ = data
      try:
        date_string = datetime.datetime(1970, 1, 1)
        date_string += datetime.timedelta(microseconds=timestamp)
        date_string = u"%s+00:00" % (date_string)
      except TypeError:
        date_string = timestamp
      except __HOLE__:
        date_string = timestamp

      output_string = u"%s\t%s\t%s\t%s\t%s\t%s" % (
          date_string, entry_type, url, data1, data2, data3)

      print output_string.encode("UTF-8")
dataset/ETHPy150Open google/grr/grr/parsers/osx_quarantine.py/main