コード例 #1
0
ファイル: buffer.py プロジェクト: TomasTomecek/sen
class ImageInfoBuffer(Buffer):
    description = "Dashboard for information about selected image."
    keybinds = {
        "enter": "display-info",
        "d": "rm",
        "i": "inspect",
        "@": "refresh",
    }

    def __init__(self, docker_image, ui):
        """
        :param docker_image:
        :param ui: ui object so we refresh
        """
        if isinstance(docker_image, RootImage):
            raise NotifyError("Image \"scratch\" doesn't provide any more information.")
        if docker_image.image_id == "<missing>":
            raise NotifyError("This image (layer) is not available due to changes in docker-1.10 "
                              "image representation.")
        self.docker_image = docker_image
        self.display_name = docker_image.short_name
        self.widget = ImageInfoWidget(ui, docker_image)
        super().__init__()

    def process_realtime_event(self, event):
        if event.get("id", None) == self.docker_image.object_id:
            self.widget.refresh()
コード例 #2
0
ファイル: buffer.py プロジェクト: rm3l/sen
class ImageInfoBuffer(Buffer):
    description = "Dashboard for information about selected image."
    keybinds = {
        "enter": "display-info",
        "d": "rm",
        "i": "inspect",
        "@": "refresh",
    }

    def __init__(self, docker_image, ui):
        """
        :param docker_image:
        :param ui: ui object so we refresh
        """
        if isinstance(docker_image, RootImage):
            raise NotifyError(
                "Image \"scratch\" doesn't provide any more information.")
        if docker_image.image_id == "<missing>":
            raise NotifyError(
                "This image (layer) is not available due to changes in docker-1.10 "
                "image representation.")
        self.docker_image = docker_image
        self.display_name = docker_image.short_name
        self.widget = ImageInfoWidget(ui, docker_image)
        super().__init__()

    def process_realtime_event(self, event):
        if event.get("id", None) == self.docker_image.object_id:
            self.widget.refresh()
コード例 #3
0
ファイル: buffer.py プロジェクト: rm3l/sen
 def __init__(self, docker_image, ui):
     """
     :param docker_image:
     :param ui: ui object so we refresh
     """
     if isinstance(docker_image, RootImage):
         raise NotifyError(
             "Image \"scratch\" doesn't provide any more information.")
     if docker_image.image_id == "<missing>":
         raise NotifyError(
             "This image (layer) is not available due to changes in docker-1.10 "
             "image representation.")
     self.docker_image = docker_image
     self.display_name = docker_image.short_name
     self.widget = ImageInfoWidget(ui, docker_image)
     super().__init__()
コード例 #4
0
ファイル: buffer.py プロジェクト: TomasTomecek/sen
 def __init__(self, docker_image, ui):
     """
     :param docker_image:
     :param ui: ui object so we refresh
     """
     if isinstance(docker_image, RootImage):
         raise NotifyError("Image \"scratch\" doesn't provide any more information.")
     if docker_image.image_id == "<missing>":
         raise NotifyError("This image (layer) is not available due to changes in docker-1.10 "
                           "image representation.")
     self.docker_image = docker_image
     self.display_name = docker_image.short_name
     self.widget = ImageInfoWidget(ui, docker_image)
     super().__init__()