WebBrowser/Download/DownloadItem.py

changeset 6090
5cdb7ea57551
parent 6085
7e48a0d98cce
child 6091
7b989321d74c
equal deleted inserted replaced
6089:ca484325f02a 6090:5cdb7ea57551
317 name = os.path.join(directory, baseName) 317 name = os.path.join(directory, baseName)
318 if endName: 318 if endName:
319 name += '.' + endName 319 name += '.' + endName
320 return name, origName 320 return name, origName
321 321
322 # TODO: duplicate code to openFile()
322 def __open(self): 323 def __open(self):
323 """ 324 """
324 Private slot to open the downloaded file. 325 Private slot to open the downloaded file.
325 """ 326 """
326 info = QFileInfo(self.__fileName) 327 info = QFileInfo(self.__fileName)
576 577
577 @return absolute path of the output file (string) 578 @return absolute path of the output file (string)
578 """ 579 """
579 return QFileInfo(self.__fileName).absoluteFilePath() 580 return QFileInfo(self.__fileName).absoluteFilePath()
580 581
582 # TODO: change from tuple to dict
581 def getData(self): 583 def getData(self):
582 """ 584 """
583 Public method to get the relevant download data. 585 Public method to get the relevant download data.
584 586
585 @return tuple of URL, save location, flag, the 587 @return tuple of URL, save location, flag, the
589 """ 591 """
590 return (self.__url, QFileInfo(self.__fileName).filePath(), 592 return (self.__url, QFileInfo(self.__fileName).filePath(),
591 self.downloadedSuccessfully(), self.__pageUrl, 593 self.downloadedSuccessfully(), self.__pageUrl,
592 self.__downloadedDateTime) 594 self.__downloadedDateTime)
593 595
596 # TODO: change from tuple to dict
594 def setData(self, data): 597 def setData(self, data):
595 """ 598 """
596 Public method to set the relevant download data. 599 Public method to set the relevant download data.
597 600
598 @param data tuple of URL, save location, flag, the 601 @param data tuple of URL, save location, flag, the

eric ide

mercurial