本文整理汇总了Python中Interface.Interface.clear方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.clear方法的具体用法?Python Interface.clear怎么用?Python Interface.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interface.Interface
的用法示例。
在下文中一共展示了Interface.clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetchAndSaveUrl
# 需要导入模块: from Interface import Interface [as 别名]
# 或者: from Interface.Interface import clear [as 别名]
def fetchAndSaveUrl(self, url="", bit=1):
ok = True
if len(url) == 0:
url, ok = QtGui.QInputDialog.getText(
self, "Link", "Download Link:", QtGui.QLineEdit.Normal, "", QtCore.Qt.FramelessWindowHint
)
if ok == True:
key = self.freeKey()
if key == -1:
obj = Interface(self.PARTS)
key = self.links
self.links = self.links + 1
else:
obj = self.dLoads[key]
obj.PARTS = self.PARTS
obj.clear()
del self.dLoads[key]
thread.start_new_thread(obj.start_Download, (url, self.wMutex, bit))
self.dLoads[key] = obj
else:
msg = QtGui.QMessageBox(
QtGui.QMessageBox.Warning,
"Oops.",
"Not a valid Url ",
QtGui.QMessageBox.Ok,
self,
QtCore.Qt.FramelessWindowHint,
)
msg.show()
示例2: YoutubeLinkDownload
# 需要导入模块: from Interface import Interface [as 别名]
# 或者: from Interface.Interface import clear [as 别名]
def YoutubeLinkDownload(self):
txt, ok = QtGui.QInputDialog.getText(
self, "YouTube Link", "YTube Link:", QtGui.QLineEdit.Normal, "", QtCore.Qt.FramelessWindowHint
)
if ok == True:
if txt.startsWith("https://www.youtube.com"):
key = self.freeKey()
if key == -1:
obj = Interface(self.PARTS)
else:
obj = self.dLoads[key]
obj.PARTS = self.PARTS
obj.clear()
del self.dLoads[key]
thread.start_new_thread(obj.start_Download, (txt, self.wMutex))
self.dLoads[self.links] = obj
self.links = self.links + 1
else:
msg = QtGui.QMessageBox(
QtGui.QMessageBox.Warning,
"Oops.",
"Not a valid YTube Url ",
QtGui.QMessageBox.Ok,
self,
QtCore.Qt.FramelessWindowHint,
)
msg.show()
示例3: downloadPartition
# 需要导入模块: from Interface import Interface [as 别名]
# 或者: from Interface.Interface import clear [as 别名]
def downloadPartition(self, url, fileName, dt, tm, length):
key = self.freeKey()
if key == -1:
obj = Interface(self.PARTS)
key = self.links
self.links = self.links + 1
else:
obj = self.dLoads[key]
obj.PARTS = self.PARTS
obj.clear()
del self.dLoads[key]
obj.url = url
obj.fileName = fileName
obj.dt = dt
obj.tm = tm
obj.length = length
bit = 0
if url.startswith("http://www.youtube.com"):
bit = 1
thread.start_new_thread(obj.start_from_Part, (self.wMutex, bit))
self.dLoads[key] = obj