Closed ksdj closed 9 years ago
Yes.
I've implemented scanInfo(id) for a specific scan and scanInfos() to get the infos for all scans. There's also a ScanInfo class that holds the result, so it's possible to do
id = client.submit(cmds, 'My First Scan')
print id
# Could poll scanInfo until scan is done
info = client.scanInfo(id)
print info
# Shortcut for waiting until it'd done
info = client.waitUntilDone(id)
print info
There should be other methods like scanLog(id) to get the logged data of a scan, lastLogSerial(id) to get the serial for that scan, ..., and finally scanCommands(id) to read the commands.
The rest of scaninfo part inclues :last_serial, commands, devices ,data. Should all these be implemented in ScanInfo Class? This will give a good encapsulation. But the their request urls are different so that they must be implemented in ScanClient Class. Such that, the use case would be like this: sc = ScanClient('localhost','4810') scinfo = sc.scanInfo(447)
scinfo .state scinfo .name ...
sc.lastSerial(447) sc.scanDevs(447) sc.lastSerial(447) sc.getData(447) We can see that the query for info for a scan lacks integrity.Rookie users may get confused since they have to remember there are 4 infomation are not called through the ScanInfo Object. If all these methods can be called from ScanInfo object that would be perfect in form. What do you think?
Hi everyone. How do you think of splitting up the scanInfo(self, scanID, infoType) into unit method? At present, the scanInfo() is calling like this: