Esempio n. 1
0
    def OnClickedSave(self, event):  # wxGlade: WatchdockFrame.<event_handler>
        result = -1
        img_tag = self.get_imgtag_in_continfo(
            self.container_line)  #[20:57].strip()
        self.cmDlg.SetRepository(self.cont_id, img_tag)
        self.cmDlg.CenterOnParent()

        result = self.cmDlg.ShowModal()
        if result == wx.ID_OK:
            msg = self.cmDlg.GetMsgValue()
            name = self.cmDlg.GetNameValue()
            imgtag = self.cmDlg.GetTagValue()
            self.cmDlg.Hide()
            self.cmDlg.Destroy()
            cmd = 'docker container commit -a "%s" -m "%s" %s %s' % (
                name, msg, self.cont_id, imgtag)
            # print('commit cmd ================================>',cmd)
            with busy.BusyInfo(
                    "Committing the container '%s' to the image '%s' ..." %
                (self.cont_id, imgtag),
                    bgColour=wx.Colour(118, 113, 113)):
                wx.SafeYield()
                self.run_cmd_sync(cmd)
            if self.testing:
                return
            self.refresh()
        else:
            print('You canceled')
            self.cmDlg.Destroy()
Esempio n. 2
0
 def OnClickedRestart(self,
                      event):  # wxGlade: WatchdockFrame.<event_handler>
     # if self.testing:
     #     self.restart(self.cont_id)
     #     return
     with busy.BusyInfo("ReStarting container... ",
                        bgColour=wx.Colour(118, 113, 113)):
         wx.SafeYield()
         self.restart(self.cont_id)
Esempio n. 3
0
 def OnclickedDelete(self,
                     event):  # wxGlade: WatchdockFrame.<event_handler>
     with busy.BusyInfo("Deleting image... ",
                        bgColour=wx.Colour(118, 113, 113)):
         wx.SafeYield()
         self.run_cmd_sync('docker image rm ' + self.img_id)
     self.btn_del.Disable()
     if self.testing:  #to prevent from getting dirty self.last_cmd_out due to refresh()
         return
     wx.CallAfter(self.refresh)
Esempio n. 4
0
 def OnClickedStart(self, event):  # wxGlade: WatchdockFrame.<event_handler>
     with busy.BusyInfo("Starting container... ",
                        bgColour=wx.Colour(118, 113, 113)):
         wx.SafeYield()
         self.start(self.cont_id)
Esempio n. 5
0
 def OnChoice(self, event):  # wxGlade: WatchdockFrame.<event_handler>
     #Add vagrant docker commands https://www.vagrantup.com/docs/cli/ssh.html
     with busy.BusyInfo("Receiving vagrant docker information... ",
                        bgColour=wx.Colour(118, 113, 113)):
         wx.SafeYield()
         self.refresh()