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


Python OrangeGbl.sql_UpdDriveRun方法代碼示例

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


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

示例1: Main

# 需要導入模塊: import OrangeGbl [as 別名]
# 或者: from OrangeGbl import sql_UpdDriveRun [as 別名]
def Main():
    try:
        rc = gL.ParseArgs()
        #---------------------------------------------- M A I N ------------------------------------------------
        # apri connessione e cursori, carica keywords in memoria
        #gL.SqLite, gL.C = gL.OpenConnectionSqlite()
        #gL.MySql, gL.Cursor = gL.OpenConnectionMySql(gL.Dsn)   
        rc = OpenDb()
        if not rc:
            print("Errore in openDb")
            return False
        gL.restart == False
        runid = gL.Restart()
        rc = gL.SetLogger("GOO", gL.RunId, gL.restart)            
        gL.log(gL.INFO, gL.Args)

        if  gL.restart == True:
            gL.RunId = runid    
            rc = gL.RunInit()
            if not rc:
                gL.log(gL.ERROR, "RunInit errato")                    
                return False
            
            rc = RestartParse()         # -----------------RESTART----------------------------------
            if not rc:   
                return False
            else:
                #chiudo le tabelle dei run
                rc = gL.RunIdStatus("END")
                rc = gL.sql_UpdDriveRun("END")
    
        # run normale
        if gL.restart == False:
            # controllo la tabella Drive e la leggo
            gL.cMySql.execute("SELECT * FROM QDrive ORDER BY rnd(starturlid)")
            gL.Drive = gL.cMySql.fetchall()
            if len(gL.Drive) == 0:
                print("Nessun run da eseguire")
            else:
                gL.RunId = gL.RunIdCreate()
                rc = gL.RunIdStatus("START")  
                if not rc:
                    gL.log(gL.ERROR, "RunId errato")        
                rc = gL.SetLogger("GOO", gL.RunId, gL.restart)
                if not rc:
                    gL.log(gL.ERROR, "SetLogger errato")        
                gL.log(gL.WARNING, "Proxy:"+str(gL.Useproxy))    
                rc = gL.RunInit()    
                if not rc:
                    gL.log(gL.ERROR, "RunInit errato")        
                
                rc = NormalParse()              # -------------------RUN------------------------------------
                if not rc:   
                    gL.log(gL.ERROR, "Run terminato in modo errato")        
                else:
                    #chiudo le tabelle dei run
                    rc = gL.RunIdStatus("END")                
            
        # chiudi DB
        gL.CloseConnectionMySql()
        gL.CloseConnectionSqlite()
        return True

    except Exception as err:
        gL.log(gL.ERROR, err)        
        return False
開發者ID:micheledalonzo,項目名稱:Orange,代碼行數:68,代碼來源:GPlaces.py


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