- #获取站点所有域名
- def GetSiteDomains(self,get):
- data = {}
- domains = public.M('domain').where('pid=?',(get.id,)).field('name,id').select();
- binding = public.M('binding').where('pid=?',(get.id,)).field('domain,id').select();
- if type(binding) == str: return binding;
- for b in binding:
- tmp = {}
- tmp['name'] = b['domain'];
- tmp['id'] = b['id'];
- domains.append(tmp);
- data['domains'] = domains;
- data['email'] = public.M('users').getField('email');
- if data['email'] == '287962566@qq.com': data['email'] = '';
- return data;
-
- def GetFormatSSLResult(self,result):
- try:
- import re
- rep = "\s*Domain:.+\n\s+Type:.+\n\s+Detail:.+"
- tmps = re.findall(rep,result);
-
- statusList = [];
- for tmp in tmps:
- arr = tmp.strip().split('\n')
- status={}
- for ar in arr:
- tmp1 = ar.strip().split(':');
- status[tmp1[0].strip()] = tmp1[1].strip();
- if len(tmp1) > 2:
- status[tmp1[0].strip()] = tmp1[1].strip() + ':' + tmp1[2];
- statusList.append(status);
- return statusList;
- except:
- return None;
复制代码
这段代码的作用是啥? |