# Path: mediahandler/util/config.py
# def make_config(new_file=None):
#     """Generates default yaml mediahandler configuration file.
# 
#     Optional argument:
#         - new_file
#             Path to a yaml mediahandler configuration file. Will
#             verify that the file exists and is readable.
#     """
# 
#     # Set default path
#     config_file = os.path.join(os.path.expanduser("~"),
#                                '.config', 'mediahandler', 'config.yml')
# 
#     # Validate config
#     if new_file and not isinstance(new_file, str):
#         raise TypeError('argument should be a string file path')
# 
#     # Check for user-provided path
#     if new_file is not None:
#         config_file = new_file
# 
#     # Check that config exists
#     if os.path.isfile(config_file) and not os.access(config_file, os.R_OK):
#         raise Warning('Configuration file cannot be opened')
# 
#     # Copy default config to user file
#     default_config = os.path.join(mh.__mediaextras__, 'config.yml')
# 
#     # Make directories for config file
#     config_path = os.path.dirname(config_file)
#     if not os.path.exists(config_path):
#         os.makedirs(config_path)
#         if not mh.__iswin__:
#             os.chmod(config_path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IXOTH)
# 
#     # Copy new configuration file to path
#     shutil.copy(default_config, config_file)
# 
#     # Modify default config values for windows
#     if mh.__iswin__:
#         _modify_config_for_windows(config_file)
# 
#     # Change permissions to current user if sudo
#     if 'SUDO_UID' in os.environ.keys():
#         with os.open(config_file, os.O_RDONLY) as filed:
#             os.fchown(filed, int(os.environ['SUDO_UID']), -1)
# 
#     return config_file


import os
from setuptools import setup
from mediahandler.util.config import make_config
            'pylast==2.3.0'
        ],
        'deluge': [
            'twisted',
            'pyopenssl'
        ],
    },

    tests_require=[
        'unittest2',
        'responses',
        'mock'
    ],

    classifiers=[
        'Topic :: Home Automation',
        'Topic :: Multimedia',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'License :: OSI Approved :: MIT License',
        'Environment :: MacOS X',
        'Environment :: Console',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Operating System :: MacOS',
        'Operating System :: POSIX :: Linux',
    ],
)

# Generate default config file

# Path: mediahandler/util/config.py
# def make_config(new_file=None):
#     """Generates default yaml mediahandler configuration file.
# 
#     Optional argument:
#         - new_file
#             Path to a yaml mediahandler configuration file. Will
#             verify that the file exists and is readable.
#     """
# 
#     # Set default path
#     config_file = os.path.join(os.path.expanduser("~"),
#                                '.config', 'mediahandler', 'config.yml')
# 
#     # Validate config
#     if new_file and not isinstance(new_file, str):
#         raise TypeError('argument should be a string file path')
# 
#     # Check for user-provided path
#     if new_file is not None:
#         config_file = new_file
# 
#     # Check that config exists
#     if os.path.isfile(config_file) and not os.access(config_file, os.R_OK):
#         raise Warning('Configuration file cannot be opened')
# 
#     # Copy default config to user file
#     default_config = os.path.join(mh.__mediaextras__, 'config.yml')
# 
#     # Make directories for config file
#     config_path = os.path.dirname(config_file)
#     if not os.path.exists(config_path):
#         os.makedirs(config_path)
#         if not mh.__iswin__:
#             os.chmod(config_path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IXOTH)
# 
#     # Copy new configuration file to path
#     shutil.copy(default_config, config_file)
# 
#     # Modify default config values for windows
#     if mh.__iswin__:
#         _modify_config_for_windows(config_file)
# 
#     # Change permissions to current user if sudo
#     if 'SUDO_UID' in os.environ.keys():
#         with os.open(config_file, os.O_RDONLY) as filed:
#             os.fchown(filed, int(os.environ['SUDO_UID']), -1)
# 
#     return config_file


# Path: setup.py
import os
from setuptools import setup
from mediahandler.util.config import make_config

            'pylast==2.3.0'
        ],
        'deluge': [
            'twisted',
            'pyopenssl'
        ],
    },

    tests_require=[
        'unittest2',
        'responses',
        'mock'
    ],

    classifiers=[
        'Topic :: Home Automation',
        'Topic :: Multimedia',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'License :: OSI Approved :: MIT License',
        'Environment :: MacOS X',
        'Environment :: Console',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Operating System :: MacOS',
        'Operating System :: POSIX :: Linux',
    ],
)

# Generate default config file

make_config()