Commit 2bc0488335b4cfa94a0bfd83e924ca573caec955

Authored by liujiqiang
1 parent fb743211

更新

commons/clientSession.py
... ... @@ -36,8 +36,8 @@ class cliSession(object):
36 36  
37 37 def loginUser(self):
38 38 """
39   -
40   - :return:
  39 + 执行登录
  40 + :return:self.webHeaders,self.clientHeaders,res.json()
41 41 """
42 42 # 返回登录信息,以及可用headers,clientHeaders用户客户端操作header,webHeaders用于web页面使用headers
43 43 res = requests.post(url=self.loginUrl,data=json.dumps(self.loginData))
... ...
commons/scripts/pwdCry.py
... ... @@ -14,6 +14,7 @@ from Crypto.Cipher import PKCS1_v1_5 as Cipher_pksc1_v1_5
14 14 from Crypto.PublicKey import RSA
15 15  
16 16 def pwdCry(string):
  17 + """登录密码加密"""
17 18 public_key = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgN7kda5L4ztOUquoHjubQIEyqBpjpaYeq+DBKXA3JNOZsMjGwLGVqfCwQg3HHAGTaWnxsp5gjmh0tSziJFgQf2u45TqA2UObOvklRhbWr56QoTNsjm72wZoSOlUzW3xHi/6PocHdy/7bMOiDf6fmYhFBZdRleX6tCAp7w6DsdbQIDAQAB'
18 19 key = '-----BEGIN PUBLIC KEY-----\n' + public_key + '\n-----END PUBLIC KEY-----'
19 20 rsakey = RSA.importKey(key)
... ...
commons/scripts/readConf.py
... ... @@ -17,6 +17,7 @@ class readConfig(object):
17 17 ROBOT_LIBRARY_VERSION = '0.1'
18 18  
19 19 def __init__(self):
  20 + # 按市场读取配置文件数据
20 21 self.conf = configparser.ConfigParser()
21 22 self.evn_name = os.name
22 23 self.file_name = r'test_config_hg.conf'
... ... @@ -27,20 +28,24 @@ class readConfig(object):
27 28 self.conf.read(self.file_path,encoding="utf-8")
28 29  
29 30 def returnSections(self):
  31 + # 读取所有的options选项
30 32 sections = self.conf.sections()
31 33 print(sections)
32 34 return sections
33 35  
34 36 def returnOptions(self,options):
  37 + # 通过options读取所有items
35 38 options = self.conf.options(options)
36 39 print(options)
37 40 return options
38 41  
39   - def returnOptionsInfo(self,items):
40   - items = self.conf.items(items)
  42 + def returnOptionsInfo(self,options):
  43 + # 通过options读取相关的items和value
  44 + items = self.conf.items(options)
41 45 print(items)
42 46  
43 47 def returnOptionsItems(self,options,items):
  48 + # 通过options和items的组合关系读取对应的value
44 49 value = self.conf.get(options,items)
45 50 print(value)
46 51 return value
... ... @@ -49,4 +54,9 @@ class readConfig(object):
49 54 print(self.file_path)
50 55 return self.file_path
51 56  
52   -# readConfig().returnOptionsItems("loginInfo","userName")
53 57 \ No newline at end of file
  58 +# rc = readConfig()
  59 +# rc.returnSections()
  60 +# rc.returnOptions("loginInfo")
  61 +# rc.returnOptionsInfo("loginInfo")
  62 +# rc.returnOptionsItems("loginInfo","username")
  63 +# rc.ReturnFilePath()
54 64 \ No newline at end of file
... ...