def main(event, context): # 初始化日志文件 utils.initLog('log.txt') utils.clearLog() config = utils.readJsonFile('config.json') # artUrl = getArticle() # getSubscribeUrl(artUrl) getSubscribeUrl()
def run_monkey(self): # add by jianan self.startTime = time.time() # end add self.cf.read('monkey.conf') package_name = self.cm.cf.get('monkey_conf', 'package_name').split(" ")[1] self.tasks["pkgName"] = package_name # self.tasks["duration"] = self.hours self.tasks["tasks"] = [] self.tasks["deviceInfo"] = self.ad.get_devices() self.stop_monkey['state'] = 'active' self.start_monkey['state'] = 'disable' try: current_path = os.getcwd() #package_name = self.cf.get('monkey_conf', 'package_name').split(" ") work_path = os.path.join(current_path, "logs") #package_name + utils.getCurrentTime() if not os.path.exists(work_path): os.mkdir(work_path) utils.clearLog() work_path = os.path.join(work_path, package_name + utils.getCurrentTime()) # package_name + utils.getCurrentTime() if not os.path.exists(work_path): os.mkdir(work_path) self.workPath = work_path t = multiprocessing.Process(target=lambda: self.mk.merge_command( work_path, *self.cm.collect(*ENTRYLIST))) t.start() #while True: # utils.clearLog() # if t.is_alive(): # time.sleep(10) #else: #self.collect(work_path) #self.analyse(work_path) #workPath = os.path.join(current_path, "logs", self.pkgName + utils.getCurrentTime()) # os.mkdir(workPath) except: self.ad.stop_monkey(status, work_path) # print "status" finally: self.tasks['crashCount'] = str(self.tasksCrashCount) self.tasks["anrCount"] = str(self.tasksAnrCount) return self.tasks
def main(event, context): # 初始化日志文件 utils.initLog('log.txt') utils.clearLog() savePoint('https://proxies.bihai.cf/vmess/sub?nc=CN&type=vmess,trojan', 'vmess.txt')