# 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
        elif name != None:
            for conf in self.configs:
                if conf["name"] and conf["name"] == name:
                    return conf
            self.log.error(self.translate("logs", "No config of the chosed type named {0} found".format(name)))
            return False

    def get_paths(self, directory):
        """Returns the paths to all extensions with config files within a directory.
        
        Args:
          directory (string): The path to the folder that extension's are within. Extensions can be up to one level below the directory given.
        
        Returns:
          config_files (array): An array of paths to all extension objects with config files that were found.
        
        Raises:
          TypeError: If no extensions exist within the directory requested.
          AssertionError: If the directory path does not exist.
        
        """
        #Check the directory and raise value error if not there
        dir_obj = QtCore.QDir(str(directory))
        if not dir_obj.exists(dir_obj.absolutePath()):
            raise ValueError(self.translate("logs", "Folder at path {0} does not exist. No Config files loaded.".format(str(directory))))
        else:
            path = dir_obj.absolutePath()

        config_files = []
        try:

# 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

        elif name != None:
            for conf in self.configs:
                if conf["name"] and conf["name"] == name:
                    return conf
            self.log.error(self.translate("logs", "No config of the chosed type named {0} found".format(name)))
            return False

    def get_paths(self, directory):
        """Returns the paths to all extensions with config files within a directory.
        
        Args:
          directory (string): The path to the folder that extension's are within. Extensions can be up to one level below the directory given.
        
        Returns:
          config_files (array): An array of paths to all extension objects with config files that were found.
        
        Raises:
          TypeError: If no extensions exist within the directory requested.
          AssertionError: If the directory path does not exist.
        
        """
        #Check the directory and raise value error if not there
        dir_obj = QtCore.QDir(str(directory))
        if not dir_obj.exists(dir_obj.absolutePath()):
            raise ValueError(self.translate("logs", "Folder at path {0} does not exist. No Config files loaded.".format(str(directory))))
        else:
            path = dir_obj.absolutePath()

        config_files = []
        try:

            for root, dirs, files in fs_utils.walklevel(path):