# 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 len(str(name)) > 0:
            _settings = self.user_settings
            _settings.remove(str(name))
            return True
        else:
            self.log.debug(self.translate("logs", "A zero length string was passed as the name of an extension to be removed. This would delete all the extensions if it was allowed to succeed."))
            raise ValueError(self.translate("logs", "You must specify an extension name greater than 1 char."))
        return False

    def save_settings(self, extension_config, extension_type="global"):
        """Saves an extensions core properties into the applications extension settings.
        
        long description
        
        Args:
          extension_config (dict) An extension config in dictionary format.
          extension_type (string): Type of extension "user" or "global". Defaults to global.
        
        Returns:
          bool: True if successful, False on any failures
        """
        _settings = self.user_settings
        #get extension dir
        try:
            extension_dir = self.libraries[extension_type]
        except KeyError:
            self.log.warning(self.translate("logs", "Invalid extension type. Please check the extension type and try again."))
            return False
        #create validator
        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

        if len(str(name)) > 0:
            _settings = self.user_settings
            _settings.remove(str(name))
            return True
        else:
            self.log.debug(self.translate("logs", "A zero length string was passed as the name of an extension to be removed. This would delete all the extensions if it was allowed to succeed."))
            raise ValueError(self.translate("logs", "You must specify an extension name greater than 1 char."))
        return False

    def save_settings(self, extension_config, extension_type="global"):
        """Saves an extensions core properties into the applications extension settings.
        
        long description
        
        Args:
          extension_config (dict) An extension config in dictionary format.
          extension_type (string): Type of extension "user" or "global". Defaults to global.
        
        Returns:
          bool: True if successful, False on any failures
        """
        _settings = self.user_settings
        #get extension dir
        try:
            extension_dir = self.libraries[extension_type]
        except KeyError:
            self.log.warning(self.translate("logs", "Invalid extension type. Please check the extension type and try again."))
            return False
        #create validator
        try:

            config_validator = validate.ClientConfig(extension_config, extension_dir)