# Path: vimswitch/Action.py
# class Action:
#     def __init__(self):
#         self.exitCode = 0
# 
#     def execute():
#         raise NotImplementedError
# 
# Path: vimswitch/ProfileCache.py
# def getProfileCache(app):
#     return app.get('profileCache', createProfileCache(app))
# 
# Path: vimswitch/ProfileCopier.py
# def getProfileCopier(app):
#     return app.get('profileCopier', createProfileCopier(app))
# 
# Path: vimswitch/ProfileRetriever.py
# def getProfileRetriever(app):
#     return app.get('profileRetriever', createProfileRetriever(app))
# 
# Path: vimswitch/Settings.py
# def getSettings(app):
#     return app.get('settings', createSettings(app))


from .Action import Action
from .ProfileCache import getProfileCache
from .ProfileCopier import getProfileCopier
from .ProfileRetriever import getProfileRetriever
from .Settings import getSettings
        self.profileRetriever = profileRetriever
        self.update = False
        self.profile = None

    def execute(self):
        self._saveCurrentProfile()
        self._retrieveProfile(self.profile)
        self.profileCopier.copyToHome(self.profile)
        self.settings.currentProfile = self.profile
        print('Switched to profile: %s' % self.profile.name)

    def _saveCurrentProfile(self):
        currentProfile = self._getCurrentProfile()
        print('Saving profile: %s' % currentProfile.name)
        self.profileCopier.copyFromHome(currentProfile)

    def _retrieveProfile(self, profile):
        if not self.profileCache.contains(profile) or self.update:
            self.profileRetriever.retrieve(profile)

    def _getCurrentProfile(self):
        if self.settings.currentProfile is None:
            currentProfile = self.settings.defaultProfile
        else:
            currentProfile = self.settings.currentProfile
        return currentProfile


def createSwitchProfileAction(app):
    settings = getSettings(app)

# Path: vimswitch/Action.py
# class Action:
#     def __init__(self):
#         self.exitCode = 0
# 
#     def execute():
#         raise NotImplementedError
# 
# Path: vimswitch/ProfileCache.py
# def getProfileCache(app):
#     return app.get('profileCache', createProfileCache(app))
# 
# Path: vimswitch/ProfileCopier.py
# def getProfileCopier(app):
#     return app.get('profileCopier', createProfileCopier(app))
# 
# Path: vimswitch/ProfileRetriever.py
# def getProfileRetriever(app):
#     return app.get('profileRetriever', createProfileRetriever(app))
# 
# Path: vimswitch/Settings.py
# def getSettings(app):
#     return app.get('settings', createSettings(app))


# Path: vimswitch/SwitchProfileAction.py
from .Action import Action
from .ProfileCache import getProfileCache
from .ProfileCopier import getProfileCopier
from .ProfileRetriever import getProfileRetriever
from .Settings import getSettings

        self.profileRetriever = profileRetriever
        self.update = False
        self.profile = None

    def execute(self):
        self._saveCurrentProfile()
        self._retrieveProfile(self.profile)
        self.profileCopier.copyToHome(self.profile)
        self.settings.currentProfile = self.profile
        print('Switched to profile: %s' % self.profile.name)

    def _saveCurrentProfile(self):
        currentProfile = self._getCurrentProfile()
        print('Saving profile: %s' % currentProfile.name)
        self.profileCopier.copyFromHome(currentProfile)

    def _retrieveProfile(self, profile):
        if not self.profileCache.contains(profile) or self.update:
            self.profileRetriever.retrieve(profile)

    def _getCurrentProfile(self):
        if self.settings.currentProfile is None:
            currentProfile = self.settings.defaultProfile
        else:
            currentProfile = self.settings.currentProfile
        return currentProfile


def createSwitchProfileAction(app):
    settings = getSettings(app)

    profileCache = getProfileCache(app)