Commits

Shuge Lee committed 7121a45

Fixed fetch captcha image failed in SSI demo

  • Participants
  • Parent commits 6c32cec

Comments (0)

Files changed (1)

File demos/demo_single_sign_in.py

 #
 # force to update system configuration
 #
-#sipc.sys_config.DEBUG = True
-#sys_config_obj = sipc.SysConfig()
-#http_resp = sys_config_obj.update_sys_config_from_srv(ignore_local = True)
-#assert http_resp.status == httplib.OK
-#user_obj.sys_config = sys_config_obj
+sys_config_obj = sipc.SysConfig(debug = True)
+http_resp = sys_config_obj.update_sys_config_from_srv(ignore_local = True)
+assert http_resp.status == httplib.OK
+user_obj.sys_config = sys_config_obj
 
 
-#sipc.ssi.DEBUG = True
 resp_obj = sipc.ssi_app_sign_in(user_obj)
 resp_status = resp_obj.status
 
         msg = "user have to recognise captcha image"
         sys.stdout.write('\n' + msg + '\n')
 
-        captcha_rec = sipc.captcha.CaptchaRecognition()
+        captcha_rec = sipc.captcha.CaptchaRecognition(sys_config = user_obj.sys_config)
         captcha_rec.parse_from_resp(resp_obj)
-        captcha_img_save_path = tempfile.mkstemp('_captcha.png')
+        captcha_img_save_path = tempfile.mkstemp('_captcha.png')[1]
         captcha_rec.download_captcha_img(captcha_img_save_path)
         
         msg = "img_save_path: %s" % captcha_img_save_path
 
         pdb.set_trace()
 
+    resp_status = resp_obj.status
 
 user_obj.update_user_info_from_ssi_sign_in_resp(ssi_resp = resp_obj)
 #user_obj.save_personal()