# Path: commotion_client/utils/fs_utils.py
# def is_file(unknown):
# def walklevel(some_dir, level=1):
# def make_temp_dir(new=None):
# def clean_dir(path=None):
# def copy_contents(start, end):
# def json_load(path):
# 
# Path: commotion_client/utils/validate.py
# class ClientConfig(object):
# class Networking(object):
#     def __init__(self, config, directory=None):
#     def config(self):
#     def config(self, value):
#     def extension_path(self):
#     def extension_path(self, value):
#     def validate_all(self):
#     def gui(self, gui_name):
#     def name(self):
#     def menu_item(self):
#     def parent(self):
#     def menu_level(self):
#     def tests(self):
#     def check_menu_text(self, menu_text):
#     def check_exists(self, file_name):
#     def check_path(self, file_name):
#     def check_path_chars(self, file_name):
#     def check_path_length(self, file_name=None):
#     def __init__(self):
#     def ipaddr(self, ip_addr, addr_type=None):
# 
# Path: commotion_client/utils/settings.py
# class UserSettingsManager(object):
#     def __init__(self):
#     def save(self):
#     def load(self):
#     def get(self):


import logging
import importlib
import shutil
import os
import re
import sys
import zipfile
import json
import zipimport
from PyQt4 import QtCore
from commotion_client.utils import fs_utils
from commotion_client.utils import validate
from commotion_client.utils import settings
from commotion_client import extensions
                    if zipfile.is_zipfile(os.path.join(root, file_name)):
                        ext_zip = zipfile.ZipFile(os.path.join(root, file_name), 'r')
                        ext_names = ext_zip.namelist()
                        for member_name in ext_names:
                            if member_name.endswith(".conf"):
                                config_files.append(os.path.join(root, file_name))
        except AssertionError:
            self.log.warn(self.translate("logs", "Extension library at path {0} does not exist. No Config files identified.".format(path)))
            raise
        except TypeError:
            self.log.warn(self.translate("logs", "No extensions found at path {0}. No Config files identified.".format(path)))
            raise
        if config_files:
            return config_files
        else:
            raise TypeError(self.translate("logs", "No config files found at path {0}. No Config files loaded.".format(path)))

    def get(self, paths=None):
        """
        Generator to retreive config files for the paths passed to it

        @param a list of paths of the configuration file to retreive
        @return config file as a dictionary
        """
        #load config file
        if not paths:
            self.log.debug(self.translate("logs", "No paths found. Attempting to load all extension manager paths list."))
            paths = self.paths
            self.log.debug(self.translate("logs", "Found paths:{0}.".format(paths)))
        for path in paths:

# Path: commotion_client/utils/fs_utils.py
# def is_file(unknown):
# def walklevel(some_dir, level=1):
# def make_temp_dir(new=None):
# def clean_dir(path=None):
# def copy_contents(start, end):
# def json_load(path):
# 
# Path: commotion_client/utils/validate.py
# class ClientConfig(object):
# class Networking(object):
#     def __init__(self, config, directory=None):
#     def config(self):
#     def config(self, value):
#     def extension_path(self):
#     def extension_path(self, value):
#     def validate_all(self):
#     def gui(self, gui_name):
#     def name(self):
#     def menu_item(self):
#     def parent(self):
#     def menu_level(self):
#     def tests(self):
#     def check_menu_text(self, menu_text):
#     def check_exists(self, file_name):
#     def check_path(self, file_name):
#     def check_path_chars(self, file_name):
#     def check_path_length(self, file_name=None):
#     def __init__(self):
#     def ipaddr(self, ip_addr, addr_type=None):
# 
# Path: commotion_client/utils/settings.py
# class UserSettingsManager(object):
#     def __init__(self):
#     def save(self):
#     def load(self):
#     def get(self):


# Path: commotion_client/utils/extension_manager.py
import logging
import importlib
import shutil
import os
import re
import sys
import zipfile
import json
import zipimport
from PyQt4 import QtCore
from commotion_client.utils import fs_utils
from commotion_client.utils import validate
from commotion_client.utils import settings
from commotion_client import extensions

                    if zipfile.is_zipfile(os.path.join(root, file_name)):
                        ext_zip = zipfile.ZipFile(os.path.join(root, file_name), 'r')
                        ext_names = ext_zip.namelist()
                        for member_name in ext_names:
                            if member_name.endswith(".conf"):
                                config_files.append(os.path.join(root, file_name))
        except AssertionError:
            self.log.warn(self.translate("logs", "Extension library at path {0} does not exist. No Config files identified.".format(path)))
            raise
        except TypeError:
            self.log.warn(self.translate("logs", "No extensions found at path {0}. No Config files identified.".format(path)))
            raise
        if config_files:
            return config_files
        else:
            raise TypeError(self.translate("logs", "No config files found at path {0}. No Config files loaded.".format(path)))

    def get(self, paths=None):
        """
        Generator to retreive config files for the paths passed to it

        @param a list of paths of the configuration file to retreive
        @return config file as a dictionary
        """
        #load config file
        if not paths:
            self.log.debug(self.translate("logs", "No paths found. Attempting to load all extension manager paths list."))
            paths = self.paths
            self.log.debug(self.translate("logs", "Found paths:{0}.".format(paths)))
        for path in paths:

            if fs_utils.is_file(path):