root/controlies/trunk/Utils/Utils.py @ 146
76 | manumora | ##############################################################################
|
|
# -*- coding: utf-8 -*-
|
|||
# Project: ControlIES
|
|||
# Module: Groups.py
|
|||
# Purpose: Groups class
|
|||
# Language: Python 2.5
|
|||
79 | manumora | # Date: 18-Feb-2011.
|
|
# Ver: 18-Feb-2011.
|
|||
76 | manumora | # Author: Manuel Mora Gordillo
|
|
# Francisco Mendez Palma
|
|||
# Copyright: 2011 - Manuel Mora Gordillo <manuito @no-spam@ gmail.com>
|
|||
# 2011 - Francisco Mendez Palma <fmendezpalma @no-spam@ gmail.com>
|
|||
#
|
|||
# ControlIES is free software: you can redistribute it and/or modify
|
|||
# it under the terms of the GNU General Public License as published by
|
|||
# the Free Software Foundation, either version 3 of the License, or
|
|||
# (at your option) any later version.
|
|||
# ControlIES is distributed in the hope that it will be useful,
|
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||
# GNU General Public License for more details.
|
|||
# You should have received a copy of the GNU General Public License
|
|||
# along with ControlIES. If not, see <http://www.gnu.org/licenses/>.
|
|||
#
|
|||
##############################################################################
|
|||
def cmpLists(list1, list2):
|
|||
81 | manumora | onlyInList1 = set(list1).difference(set(list2))
|
|
76 | manumora | onlyInList2 = set(list2).difference(set(list1))
|
|
inTwoLists = set(list1) & set(list2)
|
|||
return { 'onlyInList1':onlyInList1, 'onlyInList2':onlyInList2, 'inTwoLists':inTwoLists }
|
|||
79 | manumora | ||
def parseToLdap(string):
|
|||
string = string.replace(" ","_")
|
|||
string = string.replace("á","a").replace("é","e").replace("í","o").replace("ó","o").replace("ú","u")
|
|||
string = string.replace("Á","A").replace("É","E").replace("Í","I").replace("Ó","O").replace("Ú","U")
|
|||
string = string.replace("ñ","n").replace("Ñ","N")
|
|||
return string
|