Cosmetics

This commit is contained in:
Bernardo Damele 2010-12-13 21:34:35 +00:00
parent a02dd6b55b
commit 698f30e65e
2 changed files with 7 additions and 2 deletions

View File

@ -132,8 +132,8 @@ class Agent:
if conf.direct: if conf.direct:
return self.payloadDirect(query) return self.payloadDirect(query)
query = self.prefixQuery(query) query = self.prefixQuery(query)
query = self.suffixQuery(query) query = self.suffixQuery(query)
payload = self.payload(newValue=query) payload = self.payload(newValue=query)
return payload return payload
@ -216,6 +216,7 @@ class Agent:
if "[INFERENCE]" in payload: if "[INFERENCE]" in payload:
if kb.dbms is not None: if kb.dbms is not None:
inference = queries[kb.dbms].inference inference = queries[kb.dbms].inference
if "dbms_version" in inference: if "dbms_version" in inference:
if isDBMSVersionAtLeast(inference.dbms_version): if isDBMSVersionAtLeast(inference.dbms_version):
inferenceQuery = inference.query inferenceQuery = inference.query
@ -223,10 +224,13 @@ class Agent:
inferenceQuery = inference.query2 inferenceQuery = inference.query2
else: else:
inferenceQuery = inference.query inferenceQuery = inference.query
payload = payload.replace("[INFERENCE]", inferenceQuery) payload = payload.replace("[INFERENCE]", inferenceQuery)
elif kb.misc.testedDbms is not None: elif kb.misc.testedDbms is not None:
inferenceQuery = queries[kb.misc.testedDbms].inference.query inferenceQuery = queries[kb.misc.testedDbms].inference.query
payload = payload.replace("[INFERENCE]", inferenceQuery) payload = payload.replace("[INFERENCE]", inferenceQuery)
else: else:
errMsg = "invalid usage of inference payload without " errMsg = "invalid usage of inference payload without "
errMsg += "knowledge of underlying DBMS" errMsg += "knowledge of underlying DBMS"

View File

@ -153,6 +153,7 @@ class Web:
for count in xrange(len(choices)): for count in xrange(len(choices)):
ext = choices[count] ext = choices[count]
message += "[%d] %s%s\n" % (count + 1, ext.upper(), (" (default)" if default == ext else "")) message += "[%d] %s%s\n" % (count + 1, ext.upper(), (" (default)" if default == ext else ""))
if default == ext: if default == ext:
default = count + 1 default = count + 1