当前位置: 首页>>代码示例>>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;未经允许,请勿转载。