def main(): while True: args = user_queue.fetch_user() if args != None: if 'douban.com/group' in args[2]: cmd = ' '.join(('python3.1', DO_CI_PATH)) print('run',cmd, time.ctime()) flog.write('[LOG]\t{0}:\t run cmd:{1} with args:\n'.format(time.ctime(), cmd, args)) flog.flush() os.system(cmd) longurl = HOSTNAME + 'history/' + args[-3].split('/')[-1] cmd = ' '.join(('python2.6' , SEND_STATUS_PATH, 'msg', args[-2], args[0], args[7], longurl)) #opt, sid, send_to, content_url_short, content_url_long print('run',cmd, time.ctime()) flog.write('[LOG]\t{0}:\t run cmd:{1}\n'.format(time.ctime(), cmd)) flog.flush() os.system(cmd) else: cmd = ' '.join(('python3.1', DO_2P_PATH)) print('run',cmd, time.ctime()) flog.write('[LOG]\t{0}:\t run cmd:{1} with args:\n'.format(time.ctime(), cmd, args)) flog.flush() os.system(cmd) longurl = HOSTNAME + 'history/' + args[-3].split('/')[-1] cmd = ' '.join(('python2.6' , SEND_STATUS_PATH, 'mst', args[-2], args[0], args[5], longurl)) print('run',cmd, time.ctime()) flog.write('[LOG]\t{0}:\t run cmd:{1}\n'.format(time.ctime(), cmd)) flog.flush() os.system(cmd) user_queue.remove_first_user() time.sleep(10) else: print('No User In Queue Now:(') flog.flush() time.sleep(30)
def main(): while True: args = user_queue.fetch_user() if args != None: cmd = ' '.join(('python3.1', DO_CI_PATH)) print('run',cmd, time.ctime()) flog.write('[LOG]\t{0}:\t run cmd:{1} with args:\n'.format(time.ctime(), cmd, args)) flog.flush() os.system(cmd) user_queue.remove_first_user() time.sleep(15) else: print('No User In Queue Now:(') flog.flush() time.sleep(30)