def Main():
  argument_parser = argparse.ArgumentParser(description=(
      u'Generates an overview of the libyal libraries.'))

  argument_parser.add_argument(
      u'configuration_file', action=u'store', metavar=u'CONFIGURATION_FILE',
      default=u'projects.ini', help=(
          u'The overview generation configuration file.'))

  argument_parser.add_argument(
      u'-o', u'--output', dest=u'output_directory', action=u'store',
      metavar=u'OUTPUT_DIRECTORY', default=None,
      help=u'path of the output files to write to.')

  options = argument_parser.parse_args()

  if not options.configuration_file:
    print(u'Configuration file missing.')
    print(u'')
    argument_parser.print_help()
    print(u'')
    return False

  if not os.path.exists(options.configuration_file):
    print(u'No such configuration file: {0:s}.'.format(
        options.configuration_file))
    print(u'')
    return False

  if options.output_directory and not os.path.exists(options.output_directory):
    print(u'No such output directory: {0:s}.'.format(options.output_directory))
    print(u'')
    return False

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

  libyal_directory = os.path.abspath(__file__)
  libyal_directory = os.path.dirname(libyal_directory)
  libyal_directory = os.path.dirname(libyal_directory)

  projects_reader = ProjectsReader()

  projects = projects_reader.ReadFromFile(options.configuration_file)
  if not projects:
    print(u'Unable to read projects from configuration file: {0:s}.'.format(
        options.configuration_file))
    print(u'')
    return False

  wiki_pages = [
      (u'Overview', OverviewWikiPageGenerator),
      (u'Status', StatusWikiPageGenerator),
  ]

  for page_name, page_generator_class in wiki_pages:
    data_directory = os.path.join(libyal_directory, u'data')
    template_directory = os.path.join(data_directory, u'wiki', page_name)
    wiki_page = page_generator_class(data_directory, template_directory)

    if options.output_directory:
      filename = u'{0:s}.md'.format(page_name)
      output_file = os.path.join(options.output_directory, filename)
      output_writer = FileWriter(output_file)
    else:
      output_writer = StdoutWriter()

    if not output_writer.Open():
      print(u'Unable to open output writer.')
      print(u'')
      return False

    wiki_page.Generate(projects, output_writer)

    output_writer.Close()

  # TODO: add support for Unicode templates.

  return True
Check if a variable is divisible by a number.
dataset/ETHPy150Open libyal/libyal/scripts/overview-generate.py/Main--crossover with--dataset/ETHPy150Open GeekTrainer/Flask/Work/Trivia - Module 5/env/Lib/site-packages/jinja2/tests.py/test_divisibleby