# -*- coding: utf-8 -*-
"""
/***************************************************************************
 Gestion parcelles forestières
                                 A QGIS plugin
 Affichage informations sur click souris
 Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
                             -------------------
        begin                : 2025-03-31
        copyright            : (C) 2025 by Marc GROSJEAN
        email                : marc.grosjean@wanadoo.fr
        git sha              : $Format:%H$
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
 This script initializes the plugin, making it known to QGIS.
"""


# noinspection PyPep8Naming
def classFactory(iface):  # pylint: disable=invalid-name
    """Load CoordClick class from file CoordClick.

    :param iface: A QGIS interface instance.
    :type iface: QgsInterface
    """
    #
    import sys
    import os

    # --- Ajouter le chemin vers xlsxwriter_lib ---
    plugin_dir = os.path.dirname(__file__)
    xlsxwriter_path = os.path.join(plugin_dir, "xlsxwriter_lib")
    if xlsxwriter_path not in sys.path:
        sys.path.insert(0, xlsxwriter_path)

    # --- Import du plugin principal ---
    from .gestion_forestiere import CoordClick
    return CoordClick(iface)
