代码拉取完成,页面将自动刷新
# coding:utf-8
import os, sys
import log
import logging
import threading
import multiprocessing
import time
logger = log.Logger('log.log', clevel=logging.DEBUG, Flevel=logging.INFO)
def exccmd(cmd):
try:
return os.popen(cmd).read()
except Exception:
return None
# 线程函数
class FuncThread(threading.Thread):
def __init__(self, func, *params, **paramMap):
threading.Thread.__init__(self)
self.func = func
self.params = params
self.paramMap = paramMap
self.rst = None
self.finished = False
def run(self):
self.rst = self.func(*self.params, **self.paramMap)
self.finished = True
def getResult(self):
return self.rst
def isFinished(self):
return self.finished
def doInThread(func, *params, **paramMap):
t_setDaemon = None
if 't_setDaemon' in paramMap:
t_setDaemon = paramMap['t_setDaemon']
del paramMap['t_setDaemon']
ft = FuncThread(func, *params, **paramMap)
if t_setDaemon != None:
ft.setDaemon(t_setDaemon)
ft.start()
return ft
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。