def query(self, f_table, f_keyword, f_type = None, f_netmask = None):
path = "/api/%s/keyword/%s/" %(f_table, f_keyword)
if f_type is not None:
path = "%srtype/%s/" %(path, FLINT_TYPES[f_type])
if f_netmask is not None:
path = "%smask/%s/" %(path, str(f_netmask))
#if options.source:
#path = "%ssource/%s/"%(path, str(options.source))
if self.api.startswith("http://"):
url = "%s%s" %(self.api, path)
else:
url = "http://%s%s" %(self.api, path)
req = urllib2.Request(url)
req = self.setup_header(req, path)
return self._do_query(req, max_retry = self.MAX_RETRY)
评论列表
文章目录