Пример #1
0
    def getPreview(self, *args):
        index = self.tableWidget.currentRow()
        item = self.fileRevisions[index]
        revision = item['revision']

        data = self.getSelectedTreeItemData()
        if not data:
            return

        # Full path is stored in the final column
        filePath = data[-1]
        fileName = data[0]

        path = os.path.join(interop.getTempPath(), fileName)

        try:
            tmpPath = path
            self.p4.run_print("-o", tmpPath,
                              "{0}#{1}".format(filePath, revision))
            Utils.p4Logger().info(
                "Synced preview to {0} at revision {1}".format(
                    tmpPath, revision))
            if self.isSceneFile:
                interop.openScene(tmpPath)
            else:
                Utils.open_file(tmpPath)

        except P4Exception as e:
            displayErrorUI(e)
Пример #2
0
    def openSelectedFile(self, *args):
        index = self.tableWidget.currentRow()
        item = self.entries[index]
        fileName = item['File']
        filePath = item['Folder']

        depotFile = os.path.join(filePath, fileName)

        try:
            result = self.p4.run_fstat(depotFile)[0]
            clientFile = result['clientFile']

            if Utils.queryFileExtension(depotFile, interop.getSceneFiles()):
                interop.openScene(clientFile)
            else:
                Utils.open_file(clientFile)
        except P4Exception as e:
            displayErrorUI(e)