# Path: vimswitch/DiskIo.py
# def getDiskIo(app):
#     return app.get('diskIo', createDiskIo(app))


from .DiskIo import getDiskIo
from zipfile import ZipFile
import os
        dirContents = self.diskIo.getDirContents(srcDir)
        for item in dirContents:
            itemPath = os.path.join(srcDir, item)
            self.diskIo.move(itemPath, destDir)

    def _getRootDirName(self, zipFilename):
        zipContents = ZipFile(zipFilename).namelist()

        rootDirs = [dir for dir in zipContents if self._isZipRootDir(dir)]

        if len(rootDirs) > 1:
            raise IOError('Zipball %s has more than one root directory' % zipFilename)

        if len(rootDirs) < 1:
            raise IOError('Zipball %s has no root directory' % zipFilename)

        return rootDirs[0]

    def _isZipRootDir(self, path):
        if path.find('/') == len(path) - 1:
            return True
        else:
            return False


def getGithubZipballExtractor(app):
    return app.get('githubZipballExtractor', createGithubZipballExtractor(app))


def createGithubZipballExtractor(app):

# Path: vimswitch/DiskIo.py
# def getDiskIo(app):
#     return app.get('diskIo', createDiskIo(app))


# Path: vimswitch/GithubZipballExtractor.py
from .DiskIo import getDiskIo
from zipfile import ZipFile
import os

        dirContents = self.diskIo.getDirContents(srcDir)
        for item in dirContents:
            itemPath = os.path.join(srcDir, item)
            self.diskIo.move(itemPath, destDir)

    def _getRootDirName(self, zipFilename):
        zipContents = ZipFile(zipFilename).namelist()

        rootDirs = [dir for dir in zipContents if self._isZipRootDir(dir)]

        if len(rootDirs) > 1:
            raise IOError('Zipball %s has more than one root directory' % zipFilename)

        if len(rootDirs) < 1:
            raise IOError('Zipball %s has no root directory' % zipFilename)

        return rootDirs[0]

    def _isZipRootDir(self, path):
        if path.find('/') == len(path) - 1:
            return True
        else:
            return False


def getGithubZipballExtractor(app):
    return app.get('githubZipballExtractor', createGithubZipballExtractor(app))


def createGithubZipballExtractor(app):

    diskIo = getDiskIo(app)