예제 #1
0
파일: api.py 프로젝트: skt041959/FeelUOwn
 def save_cookies(self):
     try:
         write_json_into_file(self.cookies, DATA_PATH + self.cookies_filename)
         LOG.info("Save cookies successfully")
     except Exception as e:
         LOG.error(str(e))
         LOG.error("Save cookies failed")
예제 #2
0
파일: api.py 프로젝트: whuhenry/FeelUOwn
 def save_cookies(self):
     try:
         write_json_into_file(self.cookies,
                              DATA_PATH + self.cookies_filename)
         LOG.info("Save cookies successfully")
     except Exception as e:
         LOG.error(str(e))
         LOG.error("Save cookies failed")
예제 #3
0
 def save_login_info(self, login_data):
     if login_data['is_remember']:
         try:
             f = open(DATA_PATH + self.pw_filename, 'w')
             if self.is_autofill is not True:  # 如果不是自动填充,说明密码时已经没有加密过
                 password = login_data['password'].encode('utf-8')
                 login_data['password'] = hashlib.md5(password).hexdigest()
             data_json = json.dumps(login_data)
             write_json_into_file(data_json, f)
         except Exception as e:
             LOG.error(str(e))
     else:
         try:
             os.remove(DATA_PATH + self.pw_filename)
         except Exception as e:
             LOG.warning(str(e))
예제 #4
0
 def save_login_info(self, login_data):
     if login_data["is_remember"]:
         try:
             f = open(DATA_PATH + self.pw_filename, "w")
             if self.is_autofill is not True:  # 如果不是自动填充,说明密码时已经没有加密过
                 password = login_data["password"].encode("utf-8")
                 login_data["password"] = hashlib.md5(password).hexdigest()
             data_json = json.dumps(login_data)
             write_json_into_file(data_json, f)
         except Exception as e:
             LOG.error(str(e))
     else:
         try:
             os.remove(DATA_PATH + self.pw_filename)
         except Exception as e:
             LOG.warning(str(e))
예제 #5
0
 def save_user_info(self, data_dict):
     if write_json_into_file(data_dict, DATA_PATH + self.user_info_filename):
         LOG.info("Save User info successfully")
예제 #6
0
 def save_user_info(self, data_dict):
     if write_json_into_file(data_dict,
                             DATA_PATH + self.user_info_filename):
         LOG.info("Save User info successfully")