# Path: pacman_mirrors/functions/countryFn.py
# def build_country_list(country_selection, country_pool, geoip=False):
# def get_geoip_country(country_pool):
# 
# Path: pacman_mirrors/functions/customFn.py
# def apply_status_to_custom_mirror_pool(config, custom_pool):
# def check_custom_mirror_pool(self):
# def delete_custom_pool(self):
# def load_custom_mirror_pool(self):
# 
# Path: pacman_mirrors/functions/fileFn.py
# def check_existance_of(filename, folder=False):
# def create_dir(foldername):
# def delete_file(filename):
# def return_mirror_filename(config):
# def write_mirror_list(config, servers, custom=False,
#                       quiet=False, interactive=False):
# def read_mirror_file(filename):
# def write_mirrorlist_header(handle, custom=False):
# def write_mirrorlist_entry(handle, mirror):


from operator import itemgetter
from pacman_mirrors.functions import countryFn
from pacman_mirrors.functions import customFn
from pacman_mirrors.functions import fileFn
#
# Authors: Frede Hundewadt <echo ZmhAbWFuamFyby5vcmcK | base64 -d>

"""Pacman-Mirrors Default Pool/Mirror Functions"""



def load_config_mirror_pool(self):
    """
    Load mirrors from active mirror pool
    """
    if customFn.check_custom_mirror_pool(self) and not self.config["country_pool"]:
        customFn.load_custom_mirror_pool(self)
        self.selected_countries = self.mirrors.country_pool
    else:
        if self.config["country_pool"]:
            self.selected_countries = self.config["country_pool"]
        load_default_mirror_pool(self)
    """
    Validate the list of selected countries        
    """
    self.selected_countries = countryFn.build_country_list(self.selected_countries,
                                                           self.mirrors.country_pool,
                                                           self.geoip)


def load_default_mirror_pool(self):
    """
    Load all available mirrors
    """

# Path: pacman_mirrors/functions/countryFn.py
# def build_country_list(country_selection, country_pool, geoip=False):
# def get_geoip_country(country_pool):
# 
# Path: pacman_mirrors/functions/customFn.py
# def apply_status_to_custom_mirror_pool(config, custom_pool):
# def check_custom_mirror_pool(self):
# def delete_custom_pool(self):
# def load_custom_mirror_pool(self):
# 
# Path: pacman_mirrors/functions/fileFn.py
# def check_existance_of(filename, folder=False):
# def create_dir(foldername):
# def delete_file(filename):
# def return_mirror_filename(config):
# def write_mirror_list(config, servers, custom=False,
#                       quiet=False, interactive=False):
# def read_mirror_file(filename):
# def write_mirrorlist_header(handle, custom=False):
# def write_mirrorlist_entry(handle, mirror):


# Path: pacman_mirrors/functions/defaultFn.py
from operator import itemgetter
from pacman_mirrors.functions import countryFn
from pacman_mirrors.functions import customFn
from pacman_mirrors.functions import fileFn

#
# Authors: Frede Hundewadt <echo ZmhAbWFuamFyby5vcmcK | base64 -d>

"""Pacman-Mirrors Default Pool/Mirror Functions"""



def load_config_mirror_pool(self):
    """
    Load mirrors from active mirror pool
    """
    if customFn.check_custom_mirror_pool(self) and not self.config["country_pool"]:
        customFn.load_custom_mirror_pool(self)
        self.selected_countries = self.mirrors.country_pool
    else:
        if self.config["country_pool"]:
            self.selected_countries = self.config["country_pool"]
        load_default_mirror_pool(self)
    """
    Validate the list of selected countries        
    """
    self.selected_countries = countryFn.build_country_list(self.selected_countries,
                                                           self.mirrors.country_pool,
                                                           self.geoip)


def load_default_mirror_pool(self):
    """
    Load all available mirrors
    """

    (file, status) = fileFn.return_mirror_filename(self.config)