Beispiel #1
0
    def on_btn_diff_clicked( self ):
        sid1 = self.list_snapshots.currentSnapshotID()
        sid2 = self.combo_diff.currentSnapshotID()
        if not sid1 or not sid2:
            return

        path1 = sid1.pathBackup(self.path)
        path2 = sid2.pathBackup(self.path)

        #check if the 2 paths are different
        if path1 == path2:
            messagebox.critical( self, _('You can\'t compare a snapshot to itself') )
            return

        diff_cmd = self.config.get_str_value( 'qt4.diff.cmd', DIFF_CMD )
        diff_params = self.config.get_str_value( 'qt4.diff.params', DIFF_PARAMS )

        if not tools.check_command( diff_cmd ):
            messagebox.critical( self, _('Command not found: %s') % diff_cmd )
            return

        params = diff_params
        params = params.replace( '%1', "\"%s\"" % path1 )
        params = params.replace( '%2', "\"%s\"" % path2 )

        cmd = diff_cmd + ' ' + params + ' &'
        os.system( cmd  )
    def btnDiffClicked(self):
        sid1 = self.timeLine.currentSnapshotID()
        sid2 = self.comboDiff.currentSnapshotID()
        if not sid1 or not sid2:
            return

        path1 = sid1.pathBackup(self.path)
        path2 = sid2.pathBackup(self.path)

        #check if the 2 paths are different
        if path1 == path2:
            messagebox.critical(self,
                                _('You can\'t compare a snapshot to itself'))
            return

        diffCmd = self.config.strValue('qt.diff.cmd', DIFF_CMD)
        diffParams = self.config.strValue('qt.diff.params', DIFF_PARAMS)

        if not tools.checkCommand(diffCmd):
            messagebox.critical(self, _('Command not found: %s') % diffCmd)
            return

        # prevent backup data from being accidentally overwritten
        # by create a temporary local copy and only open that one
        if not isinstance(sid1, snapshots.RootSnapshot):
            path1 = self.parent.tmpCopy(path1, sid1)
        if not isinstance(sid2, snapshots.RootSnapshot):
            path2 = self.parent.tmpCopy(path2, sid2)

        params = diffParams
        params = params.replace('%1', '"%s"' % path1)
        params = params.replace('%2', '"%s"' % path2)

        cmd = diffCmd + ' ' + params
        subprocess.Popen(shlex.split(cmd))
Beispiel #3
0
    def btnDiffClicked(self):
        sid1 = self.timeLine.currentSnapshotID()
        sid2 = self.comboDiff.currentSnapshotID()
        if not sid1 or not sid2:
            return

        path1 = sid1.pathBackup(self.path)
        path2 = sid2.pathBackup(self.path)

        #check if the 2 paths are different
        if path1 == path2:
            messagebox.critical(self, _('You can\'t compare a snapshot to itself'))
            return

        diffCmd = self.config.strValue('qt.diff.cmd', DIFF_CMD)
        diffParams = self.config.strValue('qt.diff.params', DIFF_PARAMS)

        if not tools.checkCommand(diffCmd):
            messagebox.critical(self, _('Command not found: %s') % diffCmd)
            return

        # prevent backup data from being accidentally overwritten
        # by create a temporary local copy and only open that one
        if not isinstance(sid1, snapshots.RootSnapshot):
            path1 = self.parent.tmpCopy(path1, sid1)
        if not isinstance(sid2, snapshots.RootSnapshot):
            path2 = self.parent.tmpCopy(path2, sid2)

        params = diffParams
        params = params.replace('%1', '"%s"' %path1)
        params = params.replace('%2', '"%s"' %path2)

        cmd = diffCmd + ' ' + params
        subprocess.Popen(shlex.split(cmd))
Beispiel #4
0
    def on_btn_diff_clicked(self):
        sid1 = self.list_snapshots.currentSnapshotID()
        sid2 = self.combo_diff.currentSnapshotID()
        if not sid1 or not sid2:
            return

        path1 = sid1.pathBackup(self.path)
        path2 = sid2.pathBackup(self.path)

        #check if the 2 paths are different
        if path1 == path2:
            messagebox.critical(self,
                                _('You can\'t compare a snapshot to itself'))
            return

        diff_cmd = self.config.get_str_value('qt4.diff.cmd', DIFF_CMD)
        diff_params = self.config.get_str_value('qt4.diff.params', DIFF_PARAMS)

        if not tools.check_command(diff_cmd):
            messagebox.critical(self, _('Command not found: %s') % diff_cmd)
            return

        params = diff_params
        params = params.replace('%1', "\"%s\"" % path1)
        params = params.replace('%2', "\"%s\"" % path2)

        cmd = diff_cmd + ' ' + params + ' &'
        os.system(cmd)