def gen_password(self, mp, domain_list, size=10): r_dte = DTE_random() reply = [] for d in domain_list: i = self.get_domain_index(d) p, encoding = r_dte.generate_and_encode_password(size) self.S[i] = encoding self.machine_pass_set[i] = '1' reply.append(p) self.save() return OrderedDict(zip(domain_list, reply))
def gen_password(self, mp, domain_list, size=10): """ generates random password strings for each of the domail specified, and saves it in corresponding location. Master password (@mp) is required for that. """ r_dte = DTE_random() reply = [] for d in domain_list: i = self.get_domain_index(d) p, encoding = r_dte.generate_and_encode_password(size) self.S[i] = encoding self.machine_pass_set[i] = '1' reply.append(p) self.save() return OrderedDict(zip(domain_list, reply))