class NearFieldScanner: """ Solution for all your near fields """ def __init__(self, nfsConfig, callbackFunction=None): """ Create your own near field scanner """ # quick and dirty, TODO implement full options if not os.path.exists(nfsConfig['scanResultFolder']): os.makedirs(nfsConfig['scanResultFolder']) self.callbackFunction = callbackFunction self.scanStatus = 0 self.scanController = ScanController(nfsConfig, self._callback) def startScan(self): """ Start your scan! """ self.scanStatus = 1 self.scanController.startScan() def stopScan(self): """ Stop your scan! """ self.scanController.stopScan() def isScanning(self): """ Returns True if scanning is currently in progres. """ if self.scanStatus == 1: return True else: return False def _callback(self): self.scanStatus = 0 if self.callbackFunction is not None: self.callbackFunction()
def __init__(self, nfsConfig, callbackFunction=None): """ Create your own near field scanner """ # quick and dirty, TODO implement full options if not os.path.exists(nfsConfig['scanResultFolder']): os.makedirs(nfsConfig['scanResultFolder']) self.callbackFunction = callbackFunction self.scanStatus = 0 self.scanController = ScanController(nfsConfig, self._callback)