def run(self, project: Project, services: str):
     project.changeWorkingDirectory()
     compose = Compose()
     compose.destroy()
     if project.hasDockerSync():
         sync = Sync()
         sync.destroy()
    def add(self, path):
        project = Project(path)
        if project.getName() in self.projects:
            raise ProjectAlreadyAddedException(
                'Project %s was already added earlier.' % (path))

        self.projects[project.getName()] = project

        self.config.setProjects(self.getPlainProjects())
        return self.config.write()
    def run(self, project: Project, services: str):
        self.statusHeader()

        project.changeWorkingDirectory()
        compose = Compose()
        for container in compose.getContainers():
            statusString = str(container.getId()).ljust(20)
            statusString += str(container.name).ljust(40)
            statusString += str(container.getIpAddress()).ljust(15)
            statusString += str(container.isCreated()).ljust(10)
            statusString += str(container.isRunning()).ljust(10)
            self.interface.writeOut(statusString)
    def __init__(self):
        self.config.load()

        config = self.config.get()
        if 'projects' not in config \
        or type(config['projects']) != dict \
        or len(config['projects']) == 0:
            projects = {}
        else:
            projects = config['projects']

        for projectPath in projects:
            try:
                project = Project(projects[projectPath])
                self.projects[project.getName()] = project
            except NoDockerComposeFileException:
                pass
 def run(self, project: Project, services: str):
     project.changeWorkingDirectory()
     compose = Compose()
     compose.pull()
 def remove(self, path):
     project = Project(path)
     self.checkProject(project.getName())
     del self.projects[project.getName()]
     self.config.setProjects(self.getPlainProjects())
     return self.config.write()