def addOutClicked(self):
     diag = AddAttributeDialog(self)
     if diag.exec_():
         attName = diag.getAttributeName()
         if attName == "":
             coralApp.logError("Attribute name cannot be blank.")
             return
         attType = diag.getAttributeType()
         specs = diag.getSpecializations()
         node = self._coralNode()
         node.addOutput(attName, attType, specs)
         self.nodeInspector().refresh()
示例#2
0
 def _moveFiles(self, inData, out):
     for fromPath in inData["files"]:
         toPath = os.path.join(inData["outDir"], os.path.basename(fromPath))
         if not os.path.isfile(fromPath):
             coralApp.logError("File doesn't exist: %s" % fromPath)
             self.setLog("File doesn't exist: %s" % fromPath)
             return
         elif not os.path.exists(inData["outDir"]):
             coralApp.logError("Folder doesn't exist: %s" %
                               inData["outDir"])
             self.setLog("Folder doesn't exist: %s" % inData["outDir"])
             return
         else:
             shutil.move(fromPath, toPath)
             out.append(toPath)
     self._outfiles.outValue().setPathValues(out)
示例#3
0
 def _moveFiles(self, inData, out):
     for fromPath in inData["files"]:
         toPath = os.path.join(inData["outDir"],
                               os.path.basename(fromPath))
         if not os.path.isfile(fromPath):
             coralApp.logError("File doesn't exist: %s"%fromPath)
             self.setLog("File doesn't exist: %s"%fromPath)
             return
         elif not os.path.exists(inData["outDir"]):
             coralApp.logError("Folder doesn't exist: %s"%inData["outDir"])
             self.setLog("Folder doesn't exist: %s"%inData["outDir"])
             return
         else:
             shutil.move(fromPath, toPath)
             out.append(toPath)
     self._outfiles.outValue().setPathValues(out)
示例#4
0
    def update(self, attribute):
        coralApp.logDebug("FindFiles.update")
        location = self._location.value().stringValueAt(0)
        pattern = self._pattern.value().stringValueAt(0)

        assets = []
        if location == "":
            return
        if not os.path.isdir(location):
            coralApp.logError("Location does not exist.")
            return
        filenames = os.listdir(location)
        for filename in filenames:
            if fnmatch.fnmatch(filename, pattern):
                fullPath = os.path.join(location, filename)
                if os.path.isfile(fullPath):
                    assets.append(fullPath)

        self._files.outValue().setPathValues(assets)
        coralApp.logDebug("FindFiles.update: Done")
示例#5
0
    def update(self, attribute):
        coralApp.logDebug("FindFiles.update")
        location = self._location.value().stringValueAt(0)
        pattern = self._pattern.value().stringValueAt(0)

        assets = []
        if location == "":
            return
        if not os.path.isdir(location):
            coralApp.logError("Location does not exist.")
            return
        filenames = os.listdir(location)
        for filename in filenames:
            if fnmatch.fnmatch(filename, pattern):
                fullPath = os.path.join(location, filename)
                if os.path.isfile(fullPath):
                    assets.append(fullPath)

        self._files.outValue().setPathValues(assets)
        coralApp.logDebug("FindFiles.update: Done")