当前位置: 首页>>代码示例>>Python>>正文


Python Interface.clear方法代码示例

本文整理汇总了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()
开发者ID:AnandSrivastava,项目名称:Linux-Download-Manager,代码行数:32,代码来源:MainFrame.py

示例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()
开发者ID:AnandSrivastava,项目名称:Linux-Download-Manager,代码行数:30,代码来源:MainFrame.py

示例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
开发者ID:AnandSrivastava,项目名称:Linux-Download-Manager,代码行数:23,代码来源:MainFrame.py


注:本文中的Interface.Interface.clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。