# Path: dtformats/output_writers.py
# class OutputWriter(object):
# class StdoutWriter(OutputWriter):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):
# 
# Path: dtformats/utmp.py
# class LinuxLibc6UtmpFile(data_format.BinaryDataFile):
# class MacOSXUtmpxFile(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('utmp.yaml')
#   _EMPTY_IP_ADDRESS = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
#   _TYPES_OF_LOGIN = {
#       0: 'EMPTY',
#       1: 'RUN_LVL',
#       2: 'BOOT_TIME',
#       3: 'NEW_TIME',
#       4: 'OLD_TIME',
#       5: 'INIT_PROCESS',
#       6: 'LOGIN_PROCESS',
#       7: 'USER_PROCESS',
#       8: 'DEAD_PROCESS',
#       9: 'ACCOUNTING'}
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('utmp.yaml')
#   _TYPES_OF_LOGIN = {
#       0: 'EMPTY',
#       1: 'RUN_LVL',
#       2: 'BOOT_TIME',
#       3: 'OLD_TIME',
#       4: 'NEW_TIME',
#       5: 'INIT_PROCESS',
#       6: 'LOGIN_PROCESS',
#       7: 'USER_PROCESS',
#       8: 'DEAD_PROCESS',
#       9: 'ACCOUNTING',
#       10: 'SIGNATURE',
#       11: 'SHUTDOWN_TIME'}
#   def _DebugPrintEntry(self, entry):
#   def _DecodeString(self, byte_stream, encoding='utf8'):
#   def _ReadEntries(self, file_object):
#   def ReadFileObject(self, file_object):
#   def _DebugPrintEntry(self, entry):
#   def _DecodeString(self, byte_stream, encoding='utf8'):
#   def _ReadEntries(self, file_object):
#   def ReadFileObject(self, file_object):


import argparse
import logging
import os
import sys
from dtformats import output_writers
from dtformats import utmp

  options = argument_parser.parse_args()

  if not options.source:
    print('Source file missing.')
    print('')
    argument_parser.print_help()
    print('')
    return False

  logging.basicConfig(
      level=logging.INFO, format='[%(levelname)s] %(message)s')

  output_writer = output_writers.StdoutWriter()

  try:
    output_writer.Open()
  except IOError as exception:
    print('Unable to open output writer with error: {0!s}'.format(exception))
    print('')
    return False

  with open(options.source, 'rb') as file_object:
    file_object.seek(0, os.SEEK_SET)
    utmp_signature = file_object.read(11)

  if utmp_signature == b'utmpx-1.00\x00':
    utmp_file = utmp.MacOSXUtmpxFile(
        debug=options.debug, output_writer=output_writer)
  else:

# Path: dtformats/output_writers.py
# class OutputWriter(object):
# class StdoutWriter(OutputWriter):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):
# 
# Path: dtformats/utmp.py
# class LinuxLibc6UtmpFile(data_format.BinaryDataFile):
# class MacOSXUtmpxFile(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('utmp.yaml')
#   _EMPTY_IP_ADDRESS = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
#   _TYPES_OF_LOGIN = {
#       0: 'EMPTY',
#       1: 'RUN_LVL',
#       2: 'BOOT_TIME',
#       3: 'NEW_TIME',
#       4: 'OLD_TIME',
#       5: 'INIT_PROCESS',
#       6: 'LOGIN_PROCESS',
#       7: 'USER_PROCESS',
#       8: 'DEAD_PROCESS',
#       9: 'ACCOUNTING'}
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('utmp.yaml')
#   _TYPES_OF_LOGIN = {
#       0: 'EMPTY',
#       1: 'RUN_LVL',
#       2: 'BOOT_TIME',
#       3: 'OLD_TIME',
#       4: 'NEW_TIME',
#       5: 'INIT_PROCESS',
#       6: 'LOGIN_PROCESS',
#       7: 'USER_PROCESS',
#       8: 'DEAD_PROCESS',
#       9: 'ACCOUNTING',
#       10: 'SIGNATURE',
#       11: 'SHUTDOWN_TIME'}
#   def _DebugPrintEntry(self, entry):
#   def _DecodeString(self, byte_stream, encoding='utf8'):
#   def _ReadEntries(self, file_object):
#   def ReadFileObject(self, file_object):
#   def _DebugPrintEntry(self, entry):
#   def _DecodeString(self, byte_stream, encoding='utf8'):
#   def _ReadEntries(self, file_object):
#   def ReadFileObject(self, file_object):


# Path: scripts/utmp.py
import argparse
import logging
import os
import sys
from dtformats import output_writers
from dtformats import utmp


  options = argument_parser.parse_args()

  if not options.source:
    print('Source file missing.')
    print('')
    argument_parser.print_help()
    print('')
    return False

  logging.basicConfig(
      level=logging.INFO, format='[%(levelname)s] %(message)s')

  output_writer = output_writers.StdoutWriter()

  try:
    output_writer.Open()
  except IOError as exception:
    print('Unable to open output writer with error: {0!s}'.format(exception))
    print('')
    return False

  with open(options.source, 'rb') as file_object:
    file_object.seek(0, os.SEEK_SET)
    utmp_signature = file_object.read(11)

  if utmp_signature == b'utmpx-1.00\x00':
    utmp_file = utmp.MacOSXUtmpxFile(
        debug=options.debug, output_writer=output_writer)
  else:

    utmp_file = utmp.LinuxLibc6UtmpFile(