示例#1
0
 def execute(self):
     productionLocation = self.productionDetails[2]
     source = self.sourceDirectory
     target = self.targetDirectory
     sourceLocation = os.path.join(productionLocation, source)
     targetLocation = os.path.join(productionLocation, target)
     if svn.isKnownSVNFile(sourceLocation):
         svn.svnMove(sourceLocation, targetLocation)
     else:
         shutil.move(sourceLocation, targetLocation)
 def execute(self):
     productionLocation = self.productionDetails[2]
     source = self.sourceDirectory
     target = self.targetDirectory
     sourceLocation = os.path.join(productionLocation, source)
     targetLocation = os.path.join(productionLocation, target)
     if svn.isKnownSVNFile(sourceLocation):
         svn.svnMove(sourceLocation, targetLocation)
     else:
         shutil.move(sourceLocation, targetLocation)
 def execute(self):
     productionLocation = self.productionDetails[2]
     fileLocation = self.fileDetails[3]
     newFileLocation = os.path.join(os.path.dirname(fileLocation),self.newFilename)
     fileLocation = os.path.join(productionLocation, fileLocation)
     newFileLocation = os.path.join(productionLocation, newFileLocation)
     if svn.isKnownSVNFile(fileLocation):
         svn.svnMove(fileLocation, newFileLocation)
     else:
         shutil.move(fileLocation, newFileLocation)
示例#4
0
 def execute(self):
     productionLocation = self.productionDetails[2]
     fileLocation = self.fileDetails[3]
     newFileLocation = os.path.join(os.path.dirname(fileLocation),
                                    self.newFilename)
     fileLocation = os.path.join(productionLocation, fileLocation)
     newFileLocation = os.path.join(productionLocation, newFileLocation)
     if svn.isKnownSVNFile(fileLocation):
         svn.svnMove(fileLocation, newFileLocation)
     else:
         shutil.move(fileLocation, newFileLocation)
示例#5
0
    def execute(self):
        productionLocation = self.productionDetails[2]
        fileLocation = self.fileDetails[3]
        currentFileLocation = os.path.normcase(
            os.path.normpath(os.path.join(productionLocation, fileLocation)))
        newFileLocation = os.path.normcase(
            os.path.normpath(
                os.path.join(
                    productionLocation,
                    os.path.join(self.newLocation, self.currentFilename))))
        dirLocation = os.path.normcase(
            os.path.normpath(os.path.dirname(newFileLocation)))

        #create target directory if not existing
        if not os.path.exists(dirLocation):
            os.makedirs(dirLocation)

        if svn.isKnownSVNFile(currentFileLocation):
            svn.svnMove(currentFileLocation, newFileLocation)
        else:
            shutil.move(currentFileLocation, newFileLocation)

        #update ID and IM tags of blend files.
        if self.currentFilename.endswith(".blend"):
            handle = blendfile.openBlendFile(newFileLocation, 'r+b')

            for libraryblock in handle.FindBlendFileBlocksWithCode("LI"):
                relPath = libraryblock.Get("name").split("\0")[0]
                absPath = blendfile.blendPath2AbsolutePath(
                    currentFileLocation, relPath)
                normPath = os.path.normcase(os.path.normpath(absPath))
                newRelPath = _relpath(normPath, dirLocation)
                libraryblock.Set("name", "//" + newRelPath)

            for libraryblock in handle.FindBlendFileBlocksWithCode("IM"):
                relPath = libraryblock.Get("name").split("\0")[0]
                if len(relPath) > 0:
                    absPath = blendfile.blendPath2AbsolutePath(
                        currentFileLocation, relPath)
                    normPath = os.path.normcase(os.path.normpath(absPath))
                    newRelPath = _relpath(normPath, dirLocation)
                    libraryblock.Set("name", "//" + newRelPath)

            handle.close()

        pass
    def execute(self):
        productionLocation = self.productionDetails[2]
        fileLocation = self.fileDetails[3]
        currentFileLocation = os.path.normcase(os.path.normpath(os.path.join(productionLocation, fileLocation)))
        newFileLocation = os.path.normcase(os.path.normpath(os.path.join(productionLocation, os.path.join(self.newLocation, self.currentFilename))))
        dirLocation = os.path.normcase(os.path.normpath(os.path.dirname(newFileLocation)))
        
        #create target directory if not existing
        if not os.path.exists(dirLocation):
            os.makedirs(dirLocation)
            
        if svn.isKnownSVNFile(currentFileLocation):
            svn.svnMove(currentFileLocation, newFileLocation)
        else:
            shutil.move(currentFileLocation, newFileLocation)
        
        #update ID and IM tags of blend files.
        if self.currentFilename.endswith(".blend"):
            handle = blendfile.openBlendFile(newFileLocation, 'r+b')

            for libraryblock in handle.FindBlendFileBlocksWithCode("LI"):            
                relPath = libraryblock.Get("name").split("\0")[0]
                absPath = blendfile.blendPath2AbsolutePath(currentFileLocation, relPath)
                normPath = os.path.normcase(os.path.normpath(absPath))
                newRelPath = _relpath(normPath, dirLocation)
                libraryblock.Set("name", "//"+newRelPath)
    
            for libraryblock in handle.FindBlendFileBlocksWithCode("IM"):            
                relPath = libraryblock.Get("name").split("\0")[0]
                if len(relPath)>0:
                    absPath = blendfile.blendPath2AbsolutePath(currentFileLocation, relPath)
                    normPath = os.path.normcase(os.path.normpath(absPath))
                    newRelPath = _relpath(normPath, dirLocation)
                    libraryblock.Set("name", "//"+newRelPath)

            handle.close()
            
        pass