def uploadFrames(self): count = 0 matches = glob(self.frameGlob) matches.sort() for framePath in matches: count += 1 LOG.debug("%s) Found -> %s" % (count, framePath)) try: frame = Frame.load(framePath) self.uploadFrame(frame) except ClientConnectionError, e: LOG.debug("Client error encountered -- ignoring frame") frame.delete() except Exception, e: LOG.error("Error encountered trying to upload frame: %s" % e) if frame: frame.delete()
def frameProcessStart(self, sparkName, width, height, depth, start, number, end): """ Called by the spark when a frame is being processed. If the app is not ignoring frames then it will create a new Frame object to represent the process. Returns: None if frame should be ignored, or path for rgb file """ LOG.debug("APP: frameProcessStart called for (%s)" % (sparkName)) if self.ignoreFrames: LOG.debug("----- IGNORING FRAME! -------") return None f = Frame(uploadsDir) f.isBusy = True f.spark = sparkName f.quality = self.quality f.host = self.hostname f.createdBy = self.user f.createdOn = datetime.now() f.createdOnInSeconds = datetimeToSeconds(f.createdOn) f.number = number f.width = width f.height = height f.depth = depth f.pixelAspectRatio = self.pixelAspectRatio if self.isBurn(): f.job = self.lastJob f.status = FRAME_UPLOAD try: # associate the frame with the spark self.spark.registerFrame(f) LOG.debug("Created frame") LOG.debug("about to save") f.save() LOG.debug("ok. save is done") except SparkDuplicateFrame, e: f.delete() return None