# Path: bugzilla/_util.py
# def listify(val):
#     """Ensure that value is either None or a list, converting single values
#     into 1-element lists"""
#     if val is None:
#         return val
#     if isinstance(val, list):
#         return val
#     return [val]


import configparser
import os
import urllib.parse
from logging import getLogger
from ._util import listify


def _default_cache_location(filename):
    """
    Determine default location for passed xdg filename.
    example: ~/.cache/python-bugzilla/bugzillarc
    """
    return os.path.expanduser("~/.cache/python-bugzilla/%s" % filename)


class _BugzillaRCFile(object):
    """
    Helper class for interacting with bugzillarc files
    """
    @staticmethod
    def get_default_configpaths():
        paths = [
            '/etc/bugzillarc',
            '~/.bugzillarc',
            '~/.config/python-bugzilla/bugzillarc',
        ]
        return paths

    def __init__(self):
        self._cfg = None
        self._configpaths = None
        self.set_configpaths(None)

    def set_configpaths(self, configpaths):
        configpaths = [os.path.expanduser(p) for p in

# Path: bugzilla/_util.py
# def listify(val):
#     """Ensure that value is either None or a list, converting single values
#     into 1-element lists"""
#     if val is None:
#         return val
#     if isinstance(val, list):
#         return val
#     return [val]


# Path: bugzilla/_authfiles.py
import configparser
import os
import urllib.parse
from logging import getLogger
from ._util import listify



def _default_cache_location(filename):
    """
    Determine default location for passed xdg filename.
    example: ~/.cache/python-bugzilla/bugzillarc
    """
    return os.path.expanduser("~/.cache/python-bugzilla/%s" % filename)


class _BugzillaRCFile(object):
    """
    Helper class for interacting with bugzillarc files
    """
    @staticmethod
    def get_default_configpaths():
        paths = [
            '/etc/bugzillarc',
            '~/.bugzillarc',
            '~/.config/python-bugzilla/bugzillarc',
        ]
        return paths

    def __init__(self):
        self._cfg = None
        self._configpaths = None
        self.set_configpaths(None)

    def set_configpaths(self, configpaths):
        configpaths = [os.path.expanduser(p) for p in

                       listify(configpaths or [])]