本文整理匯總了Python中Detector.Detector.join方法的典型用法代碼示例。如果您正苦於以下問題:Python Detector.join方法的具體用法?Python Detector.join怎麽用?Python Detector.join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Detector.Detector
的用法示例。
在下文中一共展示了Detector.join方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get
# 需要導入模塊: from Detector import Detector [as 別名]
# 或者: from Detector.Detector import join [as 別名]
def get(self):
link_open = urllib2.build_opener( urllib2.HTTPCookieProcessor() )
urllib2.install_opener( link_open )
login_params = "data={\"username\":\"Spring\", \"password\":\"[email protected]\", \"mechanism\":\"plain\"}"
login_result = link_open.open( config.base_url + config.login_url, login_params )
login_data = login_result.read()
logging.info("Receive data " + login_data)
print login_data
login_json = json.loads(login_data)
login_result.close()
self.response.headers['Content-Type'] = 'text/plain'
#save sessionid for this connection
sessionid = login_json["sessionid"]
fetchor = Detector( 5, sessionid, login_json['deviceid'] )
fetchor.start()
fetchor.run()
fetchor.join()
示例2: Detector
# 需要導入模塊: from Detector import Detector [as 別名]
# 或者: from Detector.Detector import join [as 別名]
login_json = json.loads(login_data)
login_result.close()
#save sessionid for this connection
sessionid = login_json["sessionid"]
print sessionid
'''
# get devices
device_params = "data={\"sessionid\":\"" + login_json["sessionid"] + "\"}"
device_result = link_open.open( base_url + device_url, device_params );
device_data = device_result.read()
device_result.close()
device_json = json.loads(device_data)
'''
# save deviceids
boundbox = (100, 100, 150, 150)
fetchor = Detector( 5, sessionid, content['deviceid'], boundbox )
fetchor.start()
fetchor.join()
#fetchor.run()
#threadone = myTimer(1,1)
#threadtow = myTimer(2,3)
#threadone.start()
#threadtow.start()
print 'OK'
finally:
print 'Finished'