# -*- coding: utf-8 -*-
"""
/***************************************************************************
 AGLgis
                                 A QGIS plugin
 DEM
 Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
                             -------------------
        begin                : 2026-04-01
        copyright            : (C) 2026 by FARM Analytica
        email                : livia.scopel@farmanalytica.com.br
        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.
"""

import os
import sys

_plugin_dir = os.path.dirname(__file__)
_extlibs_path = os.path.join(_plugin_dir, "extlibs")

if os.path.isdir(_extlibs_path) and _extlibs_path not in sys.path:
    sys.path.insert(0, _extlibs_path)


def classFactory(interface):
    if not os.path.isdir(_extlibs_path) or not os.listdir(_extlibs_path):
        from . import extlibs_manager
        extlibs_manager.start_download()

    from .aglgis import AGLgis
    return AGLgis(interface)
