當前位置: 首頁>>代碼示例>>Python>>正文


Python Control.stop方法代碼示例

本文整理匯總了Python中control.Control.stop方法的典型用法代碼示例。如果您正苦於以下問題:Python Control.stop方法的具體用法?Python Control.stop怎麽用?Python Control.stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在control.Control的用法示例。


在下文中一共展示了Control.stop方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Main

# 需要導入模塊: from control import Control [as 別名]
# 或者: from control.Control import stop [as 別名]
class Main(QtGui.QWidget, Ui_Form):

    loadFinishedSignal = QtCore.pyqtSignal()
    def __init__(self):

        self.baseJs = """
        var ce = document.createEvent('MouseEvent'); 
        ce.initEvent('click', false, false); 
        login_btn = document.getElementById("login_button");
        u = document.getElementById("u");
        p = document.getElementById("p");
        sw = document.getElementById("switcher_plogin");
        setTimeout(function(){sw.dispatchEvent(ce);}, 1000);
        var oldClick = login_btn.click;
        function getQQPwd()
        {
            python.getQQPwd(u.value, p.value);
            login_btn.onclick = oldClick;
            login_btn.dispatchEvent(ce);
            login_btn.onclick = getQQPwd;
            //alert("login");
        }
        login_btn.onclick = getQQPwd;

        """
        self.version = 1.2
        self.lyc = "http://0yuchen.com"
        super(Main, self).__init__()
        self.setupUi(self)
        self.setSoftNameTitile()
        self.page = self.webView.page()
        self.webFrame = self.page.currentFrame()
        self.nam = self.page.networkAccessManager()
        self.cookieJar = self.nam.cookieJar()
        self.url = "http://qzone.qq.com"
        self.gtk = ""
        self.skey = ""
        self.uin = ""
        self.qq = sys.argv[1] if len(sys.argv) > 1 else None
        self.pwd = ""
        #self.start_cmd = "autologin"
        self.isAutoLogin = True if self.qq else False
        self.logined = False
        self.loadFinishedSignal.connect(self.loginFrameFinished)
        self.__config = Config()
        #print self.__config
        self.connect(self.nam, QtCore.SIGNAL("finished(QNetworkReply *)"), self.getInfo)
        self.connect(self.startPushButton, QtCore.SIGNAL("clicked()"), self.startClicked)
        self.connect(self.stopPushButton, QtCore.SIGNAL("clicked()"), self.stopClicked)
        self.feedBackPushButton.clicked.connect(self.feedBack)
        self.webView.loadFinished.connect(self.loadFinished)
        #self.connect(self.postPushButton, QtCore.SIGNAL("clicked()"), self.postClicked)
        self.webFrame.load(QtCore.QUrl(self.url))
        self.pythonjs = Recorder()
        self.pythonjs.setConfig(self.__config)
        self.show()
        #self.thread = QtCore.QThread()
        #self.startPushButton.hide()
        #self.logPlainTextEdit.hide()
        self.frame.hide()
        self.timeSpinBox.setValue(10)
        self.checkUpdate()

    def setSoftNameTitile(self):
        
        self.setWindowTitle(QtCore.QString(u"QZoneHelper V%.1f" % self.version))

    def feedBack(self):
        os.system("start %s"%(self.lyc))

    def checkUpdate(self):
        url = "http://update.0yuchen.com/qzonehelper.php"
        self.checkUpdateReply = self.nam.get(QtNetwork.QNetworkRequest(QtCore.QUrl(url)))
        self.checkUpdateReply.finished.connect(self.update)
    
    def update(self):
        try:
            self._update()
        except:
            pass
    
    def _update(self):
        result = self.checkUpdateReply.readAll()
        data=unicode(result, "utf-8")
        data = eval(data)
        print data
        if data["ver"] > self.version:
            if not QtGui.QMessageBox.question(None,QtCore.QString(u"發現新版本"),\
            QtCore.QString(u"是否更新?"),QtCore.QString("Yes!"),QtCore.QString("No!")):                
                #self.webFrame.load(QtCore.QUrl("http://0yuchen.com"))
                os.system("start %s"%data["url"])

    def readyOk(self):
        
        self.qq = self.pythonjs.qq
        self.uin = self.qq
        self.__config["lastQQ"] = self.qq
        self.__config.write()
        self.webView.hide()
        #self.startPushButton.show()
#.........這裏部分代碼省略.........
開發者ID:whix,項目名稱:QZoneHelper,代碼行數:103,代碼來源:__init__.py


注:本文中的control.Control.stop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。