# Path: vimswitch/DiskIo.py
# def getDiskIo(app):
#     return app.get('diskIo', createDiskIo(app))
# 
# Path: vimswitch/Profile.py
# class Profile:
#     def __init__(self, name):
#         self.name = name
# 
#     def getName(self):
#         return self.name
# 
#     def getDirName(self):
#         return self.name.replace('/', '.')
# 
#     def __eq__(self, other):
#         return isinstance(other, Profile) and self.name == other.name
# 
#     def __ne__(self, other):
#         return not self.__eq__(other)
# 
#     def __repr__(self):
#         return "Profile('%s')" % self.name


from .DiskIo import getDiskIo
from .Profile import Profile
from .six import StringIO
from .six.moves.configparser import SafeConfigParser
            currentProfileName = config.get('settings', 'currentProfile')
            if currentProfileName is None:
                settings.currentProfile = None
            else:
                settings.currentProfile = Profile(currentProfileName)

    def saveSettings(self, settings, path):
        config = self._getConfigParser()
        config.add_section('settings')
        if settings.currentProfile is None:
            config.set('settings', 'currentProfile', None)
        else:
            config.set('settings', 'currentProfile', settings.currentProfile.name)

        settingsIo = StringIO()
        config.write(settingsIo)
        self.diskIo.createFile(path, settingsIo.getvalue())

    def _getConfigParser(self):
        # We set allow_no_value to True because settings.currentProfile can
        # sometimes be None
        configParser = SafeConfigParser(allow_no_value=True)
        return configParser


def getConfigFile(app):
    return app.get('configFile', createConfigFile(app))


def createConfigFile(app):

# Path: vimswitch/DiskIo.py
# def getDiskIo(app):
#     return app.get('diskIo', createDiskIo(app))
# 
# Path: vimswitch/Profile.py
# class Profile:
#     def __init__(self, name):
#         self.name = name
# 
#     def getName(self):
#         return self.name
# 
#     def getDirName(self):
#         return self.name.replace('/', '.')
# 
#     def __eq__(self, other):
#         return isinstance(other, Profile) and self.name == other.name
# 
#     def __ne__(self, other):
#         return not self.__eq__(other)
# 
#     def __repr__(self):
#         return "Profile('%s')" % self.name


# Path: vimswitch/ConfigFile.py
from .DiskIo import getDiskIo
from .Profile import Profile
from .six import StringIO
from .six.moves.configparser import SafeConfigParser

            currentProfileName = config.get('settings', 'currentProfile')
            if currentProfileName is None:
                settings.currentProfile = None
            else:
                settings.currentProfile = Profile(currentProfileName)

    def saveSettings(self, settings, path):
        config = self._getConfigParser()
        config.add_section('settings')
        if settings.currentProfile is None:
            config.set('settings', 'currentProfile', None)
        else:
            config.set('settings', 'currentProfile', settings.currentProfile.name)

        settingsIo = StringIO()
        config.write(settingsIo)
        self.diskIo.createFile(path, settingsIo.getvalue())

    def _getConfigParser(self):
        # We set allow_no_value to True because settings.currentProfile can
        # sometimes be None
        configParser = SafeConfigParser(allow_no_value=True)
        return configParser


def getConfigFile(app):
    return app.get('configFile', createConfigFile(app))


def createConfigFile(app):

    diskIo = getDiskIo(app)