def main(): Log().found_log(gs_py_id, gs_basic_id) HOST, USER, PASSWD, DB, PORT = config.HOST, config.USER, config.PASSWD, config.DB, config.PORT connect, cursor = Connect_to_DB().ConnectDB(HOST, USER, PASSWD, DB, PORT) Judge(gs_py_id, connect, cursor, gs_basic_id, url, pagenumber, perpage).update_branch(update_brand_py, Brand, "brand") cursor.close() connect.close()
def main(): Log().found_log(gs_py_id,gs_basic_id) HOST, USER, PASSWD, DB, PORT = config.HOST, config.USER, config.PASSWD, config.DB, config.PORT connect, cursor = Connect_to_DB().ConnectDB(HOST, USER, PASSWD, DB, PORT) pages, perpages = 0, 0 Judge(gs_py_id,connect,cursor,gs_basic_id,url,pages,perpages).update_branch(update_punish_py,Punish,"punish") cursor.close() connect.close()
def main(): Log().found_log(gs_py_id, gs_basic_id) # HOST, USER, PASSWD, DB, PORT = config.HOST, config.USER, config.PASSWD, config.DB, config.PORT # connect, cursor = Connect_to_DB().ConnectDB(HOST, USER, PASSWD, DB, PORT) connect, cursor = None, None pages, perpages = 0, 0 Judge(gs_py_id, connect, cursor, gs_basic_id, url, pages, perpages).update_branch(update_person_py, Person, "person")
def main(): Log().found_log(gs_py_id,gs_basic_id) HOST, USER, PASSWD, DB, PORT = config.HOST, config.USER, config.PASSWD, config.DB, config.PORT connect, cursor = Connect_to_DB().ConnectDB(HOST, USER, PASSWD, DB, PORT) pages, perpages = 0,0 urllist = url.split('qisuso') Judge(gs_py_id, connect, cursor, gs_basic_id, urllist,pages,perpages).update_branch(update_change_py, Change, "change") cursor.close() connect.close()
def main(): Log().found_log(gs_py_id, gs_basic_id) HOST, USER, PASSWD, DB, PORT = config.HOST, config.USER, config.PASSWD, config.DB, config.PORT connect, cursor = Connect_to_DB().ConnectDB(HOST, USER, PASSWD, DB, PORT) flag, total, insert_total, update_total = update_report( url, cursor, connect, gs_basic_id, gs_py_id) cursor.close() connect.close() info = {"flag": 0, "total": 0, "insert": 0, "update": 0} info["flag"] = int(flag) info["total"] = int(total) info["insert"] = int(insert_total) info["update"] = int(update_total) print info
def main(): Log().found_log(gs_py_id,gs_basic_id) HOST, USER, PASSWD, DB, PORT = config.HOST, config.USER, config.PASSWD, config.DB, config.PORT connect, cursor = Connect_to_DB().ConnectDB(HOST, USER, PASSWD, DB, PORT) flag,recordstotal,update_total,insert_total = update_branch3(cursor, connect, gs_basic_id,gs_py_id, select_check_py, update_check_py, Check, "check") cursor.close() connect.close() info = { "flag": 0, "total": 0, "update": 0, "insert": 0, 'totalpage': 0, 'perpage': 0 } info["flag"] = int(flag) info["total"] = int(recordstotal) info["update"] = int(update_total) info["insert"] = int(insert_total) print info
def main(): Log().found_log(gs_py_id, gs_basic_id) HOST, USER, PASSWD, DB, PORT = config.HOST, config.USER, config.PASSWD, config.DB, config.PORT connect, cursor = Connect_to_DB().ConnectDB(HOST, USER, PASSWD, DB, PORT) try: select_string = select_report % gs_basic_id count = cursor.execute(select_string) if count == 1: for data1, data2, data3 in cursor.fetchall(): if data1 == u'无' or data1 == '': data1 = None if data2 == u'无' or data2 == '': data2 = None if data3 == u'无' or data3 == '': data3 = None tel = data1 address = data2 email = data3 updated_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) cursor.execute( update_address, (gs_basic_id, tel, address, email, updated_time, gs_basic_id)) connect.commit() info, flag, url_list = get_url_list(url) if flag < 100000001: flag = update_basic(info, connect, cursor, gs_basic_id) updated_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) cursor.execute(update_py, (gs_py_id, flag, updated_time, gs_py_id)) connect.commit() except Exception, e: flag = 100000005 logging.error('basic error %s' % e)
if history_name != None: select_string = select_basic % gs_basic_id count = cursor.execute(select_string) if count == 0: cursor.execute(insert_history, (gs_basic_id, history_name, updated_time)) connect.commit() elif int(count) == 1: gs_basic_exp_id = cursor.fetchall()[0][0] cursor.execute(update_basic, (gs_basic_exp_id, gs_basic_id, history_name, updated_time, gs_basic_exp_id)) connect.commit() except Exception, e: logging.error('get url error %s' % e) finally: cursor.close() connect.close() print info if __name__ == "__main__": print "The Program start time:", time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) start = time.time() Log().found_log(gs_basic_id, gs_basic_id) main(code, ccode) print "The Program end time:", time.strftime( "%Y-%m-%d %H:%M:%S", time.localtime()), "[%s]" % (time.time() - start)
def main(): Log().found_log(gs_py_id, gs_basic_id) HOST, USER, PASSWD, DB, PORT = config.HOST, config.USER, config.PASSWD, config.DB, config.PORT connect, cursor = Connect_to_DB().ConnectDB(HOST, USER, PASSWD, DB, PORT) Judge(gs_py_id, connect, cursor, gs_basic_id, url, pagenumber, perpage).update_branch(update_share_py, Shareholder, "share")