# Path: dtformats/gzipfile.py
# class GZipFile(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('gzipfile.yaml')
#   _GZIP_SIGNATURE = 0x8b1f
#   _COMPRESSION_METHOD_DEFLATE = 8
#   _FLAG_FTEXT = 0x01
#   _FLAG_FHCRC = 0x02
#   _FLAG_FEXTRA = 0x04
#   _FLAG_FNAME = 0x08
#   _FLAG_FCOMMENT = 0x10
#   _BUFFER_SIZE = 16 * 1024 * 1024
#   _DEBUG_INFO_MEMBER_FOOTER = [
#       ('checksum', 'Checksum', '_FormatIntegerAsHexadecimal8'),
#       ('uncompressed_data_size', 'Uncompressed data size',
#        '_FormatIntegerAsDecimal')]
#   _DEBUG_INFO_MEMBER_HEADER = [
#       ('signature', 'Signature', '_FormatIntegerAsHexadecimal4'),
#       ('compression_method', 'Compression method', '_FormatStreamAsDecimal'),
#       ('flags', 'Flags', '_FormatIntegerAsHexadecimal2'),
#       ('modification_time', 'Modification time', '_FormatIntegerAsPosixTime'),
#       ('operating_system', 'Operating system', '_FormatStreamAsDecimal'),
#       ('compression_flags', 'Compression flags',
#        '_FormatIntegerAsHexadecimal2')]
#   def _ReadCompressedData(self, zlib_decompressor, compressed_data):
#   def _ReadMemberCompressedData(self, file_object):
#   def _ReadMemberFooter(self, file_object):
#   def _ReadMemberHeader(self, file_object):
#   def ReadFileObject(self, file_object):
# 
# 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):


import argparse
import logging
import sys
from dtformats import gzipfile
from dtformats import output_writers

  argument_parser.add_argument(
      '-d', '--debug', dest='debug', action='store_true', default=False,
      help='enable debug output.')

  argument_parser.add_argument(
      'source', nargs='?', action='store', metavar='PATH',
      default=None, help='path of the GZIP compressed stream file.')

  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


# Path: dtformats/gzipfile.py
# class GZipFile(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('gzipfile.yaml')
#   _GZIP_SIGNATURE = 0x8b1f
#   _COMPRESSION_METHOD_DEFLATE = 8
#   _FLAG_FTEXT = 0x01
#   _FLAG_FHCRC = 0x02
#   _FLAG_FEXTRA = 0x04
#   _FLAG_FNAME = 0x08
#   _FLAG_FCOMMENT = 0x10
#   _BUFFER_SIZE = 16 * 1024 * 1024
#   _DEBUG_INFO_MEMBER_FOOTER = [
#       ('checksum', 'Checksum', '_FormatIntegerAsHexadecimal8'),
#       ('uncompressed_data_size', 'Uncompressed data size',
#        '_FormatIntegerAsDecimal')]
#   _DEBUG_INFO_MEMBER_HEADER = [
#       ('signature', 'Signature', '_FormatIntegerAsHexadecimal4'),
#       ('compression_method', 'Compression method', '_FormatStreamAsDecimal'),
#       ('flags', 'Flags', '_FormatIntegerAsHexadecimal2'),
#       ('modification_time', 'Modification time', '_FormatIntegerAsPosixTime'),
#       ('operating_system', 'Operating system', '_FormatStreamAsDecimal'),
#       ('compression_flags', 'Compression flags',
#        '_FormatIntegerAsHexadecimal2')]
#   def _ReadCompressedData(self, zlib_decompressor, compressed_data):
#   def _ReadMemberCompressedData(self, file_object):
#   def _ReadMemberFooter(self, file_object):
#   def _ReadMemberHeader(self, file_object):
#   def ReadFileObject(self, file_object):
# 
# 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: scripts/gzipfile.py
import argparse
import logging
import sys
from dtformats import gzipfile
from dtformats import output_writers


  argument_parser.add_argument(
      '-d', '--debug', dest='debug', action='store_true', default=False,
      help='enable debug output.')

  argument_parser.add_argument(
      'source', nargs='?', action='store', metavar='PATH',
      default=None, help='path of the GZIP compressed stream file.')

  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


  gzip_file = gzipfile.GZipFile(