本文整理汇总了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'