Exemplo n.º 1
0
 def processOutput(self, data):
     print "[DVDformatTask processOutput]  ", data
     if data.endswith("%"):
         data = data.replace("\x08", "")
         self.progress = int(float(data[:-1]) * 10)
     else:
         Task.processOutput(self, data)
Exemplo n.º 2
0
 def processOutput(self, data):
     print("[DVDBurn] DVDformatTask processOutput ", data)
     if data.endswith('%'):
         data = data.replace('\x08', '')
         self.progress = int(float(data[:-1]) * 10)
     else:
         Task.processOutput(self, data)
Exemplo n.º 3
0
    def processOutput(self, data):

        if os.path.exists(self.filename):

            filesize = os.path.getsize(self.filename)
            currd = round(float((filesize) / (1024.0 * 1024.0)), 2)
            totald = 600  #round(float((totalbytes) / (1024.0 * 1024.0)),1)
            recvbytes = filesize
            totalbytes = 600 * 1024 * 1024
            self.progress = int(currd)

        try:
            if data.endswith('%)'):
                startpos = data.rfind("sec (") + 5
                if startpos and startpos != -1:
                    self.progress = int(float(data[startpos:-4]))
            elif data.find('%') != -1:
                tmpvalue = data[:data.find("%")]
                tmpvalue = tmpvalue[tmpvalue.rfind(" "):].strip()
                tmpvalue = tmpvalue[tmpvalue.rfind("(") + 1:].strip()
                print "105", tmpvalue
                #self.progress =int(float(tmpvalue))
            else:
                Task.processOutput(self, data)
        except Exception, errormsg:
            print "Error processOutput: " + str(errormsg)
            Task.processOutput(self, data)
Exemplo n.º 4
0
 def processOutput(self, data):
     try:
         if data.endswith('%)'):
             startpos = data.rfind("sec (") + 5
             if startpos and startpos != -1:
                 self.progress = int(float(data[startpos:-4]))
         elif data.find('%') != -1:
             tmpvalue = data[:data.find("%")]
             tmpvalue = tmpvalue[tmpvalue.rfind(" "):].strip()
             tmpvalue = tmpvalue[tmpvalue.rfind("(") + 1:].strip()
             self.progress = int(float(tmpvalue))
         else:
             Task.processOutput(self, data)
     except Exception as errormsg:
         Task.processOutput(self, data)
Exemplo n.º 5
0
	def processOutput(self, data):
		try:
			if data.endswith('%)'):
				startpos = data.rfind("sec (")+5
				if startpos and startpos != -1:
					self.progress = int(float(data[startpos:-4]))
			elif data.find('%') != -1:
				tmpvalue = data[:data.find("%")]
				tmpvalue = tmpvalue[tmpvalue.rfind(" "):].strip()
				tmpvalue = tmpvalue[tmpvalue.rfind("(")+1:].strip()
				self.progress = int(float(tmpvalue))
			else:
				Task.processOutput(self, data)
		except Exception, errormsg:
			print "Error processOutput: " + str(errormsg)
			Task.processOutput(self, data)
Exemplo n.º 6
0
 def processOutput(self, data):
     if os.path.exists(self.filename):
         filesize = os.path.getsize(self.filename)
         currd = round(float(filesize / 1048576.0), 2)
         totald = 600
         recvbytes = filesize
         totalbytes = 629145600
         self.progress = int(currd)
     try:
         if data.endswith('%)'):
             startpos = data.rfind('sec (') + 5
             if startpos and startpos != -1:
                 self.progress = int(float(data[startpos:-4]))
         elif data.find('%') != -1:
             tmpvalue = data[:data.find('%')]
             tmpvalue = tmpvalue[tmpvalue.rfind(' '):].strip()
             tmpvalue = tmpvalue[tmpvalue.rfind('(') + 1:].strip()
             print '105', tmpvalue
         else:
             Task.processOutput(self, data)
     except Exception as errormsg:
         print 'Error processOutput: ' + str(errormsg)
         Task.processOutput(self, data)