def _processBLEPacket(self, packet): packet.boardId = self._boardId self._appendPacket(packet) self.notify("NEW_BLE_PACKET", {"packet": packet}) self._captureHandler.writePacket(packet) self._nProcessedPackets += 1 if packet.OK: try: if packet.blePacket.accessAddress == ADV_ACCESS_ADDRESS: if self.state == STATE_FOLLOWING and packet.blePacket.advType == 5: self._connectionAccessAddress = packet.blePacket.accessAddress if self.state == STATE_SCANNING: if (packet.blePacket.advType == 0 or packet.blePacket.advType == 1 or packet.blePacket.advType == 2 or packet.blePacket.advType == 4 or packet.blePacket.advType == 6) and ( packet.blePacket.advAddress != None) and ( packet.crcOK and not packet.direction): newDevice = Devices.Device( address=packet.blePacket.advAddress, name=packet.blePacket.name, RSSI=packet.RSSI, txAdd=packet.txAdd) self._devices.appendOrUpdate(newDevice) except Exception as e: logging.exception("packet processing error") self.notify("PACKET_PROCESSING_ERROR", {"errorString": str(e)})
def createDevice(self, devName, devType, exec_address, rel_address): # Handle purely local creation of a device if self.node is None: self.devicelist[devName] = {} if devType != '': try: device = getattr(Devices, devType)(devName) except AttributeError: return False else: device = Devices.Device(devName) self.devicelist[devName]['Address'] = device self.devicelist[devName]['AddressType'] = 'pointer' if devType != '': self.devicelist[devName]['Address'].executor = self return True # Handle local creation at remote request elif self.node.name == rel_address: try: device = getattr(Devices, devType)(devName) except AttributeError: return False self.devicelist[devName] = {} self.devicelist[devName]['Address'] = device self.devicelist[devName]['AddressType'] = 'pointer' self.devicelist[devName]['Address'].executor = self return True # Handle remote creation of a device else: self.devicelist[devName] = {} self.devicelist[devName]['Address'] = rel_address self.devicelist[devName]['AddressType'] = 'zmqNode' return self._send_message( subject='target.executor.createDevice', args=[devName, devType, rel_address, rel_address], target=rel_address, )
import Log sys.path.append('/home/centos/www/Classes/Instagram') import LoginInsta import FollowInsta sys.path.append('/home/centos/www/Classes/Dizu') import LoginDizu import ConectarDizu sys.path.append('/home/centos/www/Bibliotecas/') import Config #Generate random device to change browser viewport and bypass recaptcha device = Devices.Device('', True) chrome = Driver.Chrome() chrome.set_viewport_size(device.width,device.height) tempPath = Config.getTempPath() fileName = "log" fields = ["ID","Account","Date","Time","Event","Stage","Value","Content","png","html","js","ViewPort","User-Agent"] log = Log.LogCSV(tempPath, fileName, fields) log.device = device.name try: ok = chrome.getRetries('https://www.instagram.com', 3, 10) if ok == True: xpathUser = '******' xpathPass = '******'
import LoginInsta import FollowInsta import ErrorInsta import NoticeInsta sys.path.append('/home/centos/www/Classes/Dizu') import LoginDizu import ConectarDizu import ErrorDizu import NoticeDizu processId = os.getpid() #Generate random device random = True device = Devices.Device('', random) #Chnage viewport to bypass recaptcha chrome = Driver.Chrome() chrome.set_viewport_size(device.width, device.height) driver = chrome.webdriver tempPath = "/home/centos/www/temp" fileName = "log" fields = [ "ID", "Account", "Date", "Time", "Event", "Stage", "Value", "Content", "png", "html", "js", "ViewPort", "User-Agent" ] log = Log.LogCSV(tempPath, fileName, fields) try: