Ejemplo n.º 1
0
 def __rollback(self,cmdline):
     try:
         cmdline=cmdline.split('\0')
         if cmdline[3]=='0':
             requireme(self.homedir,cmdline[2], cmdline[4])
         else:
             requireme(self.homedir,cmdline[2], cmdline[3])
         path=os.path.join(self.homedir,cmdline[2],cmdline[4])
         fhead,ftail=os.path.split(cmdline[4])
         target=os.path.join(self.homedir,self.projectsdir,self.savedir,ftail+'__rollback')
         number=ftail.split('_')[1]
         oldsavedir=fhead
         
         # import win_* files from previous savefiles
         try:
             shutil.move(os.path.join(self.homedir,cmdline[2],cmdline[4]),target)
         except Exception,e:
             out(str(e))
             target=None
             pass
         
         # import hardcopy.* files from previous savefiles
         fhead,ftail=os.path.split(cmdline[3])
         target2=os.path.join(self.homedir,self.projectsdir,self.savedir,ftail+'__rollback')
         try:
             shutil.move(os.path.join(self.homedir,cmdline[2],cmdline[3]),target2)
         except Exception,e:
             #out(str(e))
             target2=None
             pass
Ejemplo n.º 2
0
    def __rollback(self, cmdline):
        try:
            cmdline = cmdline.split('\x00')
            if cmdline[3] == '0':
                requireme(self.homedir, cmdline[2], cmdline[4])
            else:
                requireme(self.homedir, cmdline[2], cmdline[3])
            path = os.path.join(self.homedir, cmdline[2], cmdline[4])
            (fhead, ftail) = os.path.split(cmdline[4])
            target = os.path.join(self.homedir, self.projectsdir, self.savedir,
                                  ftail + '__rollback')
            number = ftail.split("_")[1]
            oldsavedir = fhead

            # import win_* files from previous savefiles

            try:
                shutil.move(os.path.join(self.homedir, cmdline[2],
                            cmdline[4]), target)
            except Exception:
                target = None
                pass

            # import hardcopy.* files from previous savefiles

            (fhead, ftail) = os.path.split(cmdline[3])
            target2 = os.path.join(self.homedir, self.projectsdir, self.savedir,
                                   ftail + '__rollback')
            try:
                shutil.move(os.path.join(self.homedir, cmdline[2],
                            cmdline[3]), target2)
            except Exception:
                target2 = None
                pass

            if os.path.isfile(target):

                # fhead is savefile base name

                return (target, target2, os.path.join(self.homedir,
                        cmdline[2], fhead))
            else:
                return (None, None, None)
        except:
            return (None, None, None)
Ejemplo n.º 3
0
    def __rollback(self, cmdline):
        try:
            cmdline = cmdline.split("\x00")
            if cmdline[3] == "0":
                requireme(self.homedir, cmdline[2], cmdline[4])
            else:
                requireme(self.homedir, cmdline[2], cmdline[3])
            path = os.path.join(self.homedir, cmdline[2], cmdline[4])
            (fhead, ftail) = os.path.split(cmdline[4])
            target = os.path.join(self.homedir, self.projectsdir, self.savedir, ftail + "__rollback")
            number = ftail.split("_")[1]
            oldsavedir = fhead

            # import win_* files from previous savefiles

            try:
                shutil.move(os.path.join(self.homedir, cmdline[2], cmdline[4]), target)
            except Exception:
                target = None
                pass

            # import hardcopy.* files from previous savefiles

            (fhead, ftail) = os.path.split(cmdline[3])
            target2 = os.path.join(self.homedir, self.projectsdir, self.savedir, ftail + "__rollback")
            try:
                shutil.move(os.path.join(self.homedir, cmdline[2], cmdline[3]), target2)
            except Exception:
                target2 = None
                pass

            if os.path.isfile(target):

                # fhead is savefile base name

                return (target, target2, os.path.join(self.homedir, cmdline[2], fhead))
            else:
                return (None, None, None)
        except:
            return (None, None, None)