Changeset 352 for trunk/aeres/scripts
- Timestamp:
- 02/19/14 16:16:49 (10 years ago)
- Location:
- trunk/aeres/scripts
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aeres/scripts/aeresrh.py
r325 r352 1 1 #!/usr/bin/env python 2 # -*- coding: iso-8859-1-*-2 # -*- coding: utf-8 -*- 3 3 4 4 """ … … 15 15 .. option:: --ifile <file> 16 16 17 17 file to read 18 18 19 19 .. only:: man 20 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 21 Figure is visible on PDF and HTML documents only. 22 23 .. only:: html or latex 24 25 .. graphviz:: 26 27 digraph aeresrh { 28 rh [shape=diamond, 29 fontname=Courier, 30 label='{ifile}' 31 32 aeresrh [shape=box, 33 fontname=Courier, 34 color=blue, 35 URL="http://forge.ipsl.jussieu.fr/pulsation/browser/trunk/aeres/scripts/aeresrh.py", 36 label="${PROJECT}/aeres/scripts/aeresrh.py"]; 37 } 38 38 39 39 SEE ALSO … … 50 50 ======== 51 51 52 :: 53 54 aeresrh.py --ifile ${PROJECT}/data/aeresrh.xls55 56 aeresrh.py --ifile ${HOME}/Downloads/personnel_francoise.xls52 .. code-block:: bash 53 54 aeresrh.py --ifile ${PROJECT}/data/aeresrh.xls 55 56 aeresrh.py --ifile ${HOME}/Downloads/personnel_francoise.xls 57 57 58 58 TODO … … 66 66 67 67 comment j'ai la liste des gens partis au 30 juin 2012 avec 68 publication (retraite, d ecès, mutation)68 publication (retraite, décÚs, mutation) 69 69 70 70 test with real file (encoding, francais, etc) … … 83 83 - fplod 20120426 84 84 85 * big process in diction nary using itertools85 * big process in dictionary using itertools 86 86 87 87 - fplod 20120410 88 88 89 89 * real titles 90 * start diction nary90 * start dictionary 91 91 92 92 - fplod 20120409 … … 101 101 - fplod 20120405 102 102 103 * gestion des temps (arriv ée, départ) (to be cont.)103 * gestion des temps (arrivée, départ) (to be cont.) 104 104 * creation draft 105 105 thanks to http://www.portailsig.org/content/python-lire-et-ecrire-des-fichiers-microsoft-excel-application-quantum-gis … … 181 181 print('sheets name %s' % ( wb.sheet_names())) 182 182 183 # lecture des donn ées dans la première feuille183 # lecture des données dans la premiÚre feuille 184 184 sh = wb.sheet_by_index(0) 185 185 … … 221 221 # detect firstname column 222 222 for colnum in range(sh.ncols): 223 if sh.col_values(colnum)[titlerow] == u'Pr énom':223 if sh.col_values(colnum)[titlerow] == u'Prénom': 224 224 colfirstname = colnum 225 225 if is_verbose == True: -
trunk/aeres/scripts/build_firstname_id.py
r325 r352 1 1 #!/usr/bin/env python 2 # -*- coding: iso-8859-1-*-2 # -*- coding: utf-8 -*- 3 3 4 4 """ … … 11 11 =========== 12 12 13 generation de la partie "prénom" de l'id : 14 - suppress blanks 15 - suppress punctation 16 - replace diacritals by their non-diacriticals equivalent (ie ï become i) 13 génération de la partie "prénom" de l'id : 14 15 - suppress blanks 16 - suppress punctation 17 - replace diacriticals by their non-diacriticals equivalent (ie ï become i) 17 18 18 19 SEE ALSO … … 28 29 cf. doctest 29 30 30 :: 31 .. code-block:: bash 31 32 32 33 python -v build_firstname_id 33 34 34 35 TODO … … 75 76 >>> firstname 76 77 [u' Ginette', u'Gin ette ', u"G\'in ette "] 77 >>> firstname.append(u"G ïnette")78 >>> firstname.append(u"Gïnette") 78 79 >>> firstname 79 80 [u' Ginette', u'Gin ette ', u"G'in ette ", u'G\xefnette'] … … 134 135 import sys 135 136 sys.exit(1) 136 137 -
trunk/aeres/scripts/build_surname_id.py
r349 r352 1 1 #!/usr/bin/env python 2 # -*- coding: iso-8859-1-*-2 # -*- coding: utf-8 -*- 3 3 4 4 """ … … 14 14 - suppress blanks 15 15 - suppress punctation 16 - replace diacrit als by their non-diacriticals equivalent (ie ïbecome i)16 - replace diacriticals by their non-diacriticals equivalent (ie ï become i) 17 17 - uppercase every characters 18 18 … … 27 27 cf. doctest 28 28 29 :: 29 .. code-block:: bash 30 30 31 31 python -v build_surname_id 32 32 33 33 TODO -
trunk/aeres/scripts/define_loceanaffectation.py
r322 r352 1 1 #!/usr/bin/env python 2 # -*- coding: iso-8859-1-*-2 # -*- coding: utf-8 -*- 3 3 4 4 … … 19 19 ======== 20 20 21 :: 21 .. code-block:: bash 22 22 23 define_loceanaffectation.py 24 23 define_loceanaffectation.py 25 24 26 25 TODO … … 59 58 automation of no diacritical and no punctation transformation 60 59 61 diction nary instead of list60 dictionary instead of list 62 61 """ 63 62 affectation_bibtool = [] 64 63 affectation_title = [] 65 64 66 65 affectation_bibtool.append("mnhn") 67 66 affectation_title.append("mnhn") … … 81 80 if __name__ == '__main__': 82 81 title, bibtool = define_loceanaffectation() 83 print(' title : %s , bibtool : %s' % (title,bibtool)) 82 print(' title : %s , bibtool : %s' % (title,bibtool)) -
trunk/aeres/scripts/ldap_biblio.py
r325 r352 1 1 #! /usr/bin/env python 2 # -*- coding: iso-8859-15-*-2 # -*- coding: utf-8 -*- 3 3 4 4 """ … … 11 11 ======== 12 12 13 :: 14 15 ldap_biblio.py13 .. code-block:: bash 14 15 ldap_biblio.py 16 16 17 17 DESCRIPTION … … 50 50 ======== 51 51 52 :: 53 54 ldap_biblio.py52 .. code-block:: bash 53 54 ldap_biblio.py 55 55 56 56 TIPS 57 57 ==== 58 58 59 To install ldap for python on mac lion:: 60 61 sudo pip install --upgrade python-ldap==2.3.13 62 63 see troubles with newer release in 59 To install ldap for python on mac lion: 60 61 .. code-block:: bash 62 63 sudo pip install --upgrade python-ldap==2.3.13 64 65 see troubles with newer release in 64 66 http://stackoverflow.com/questions/6475118/python-ldap-os-x-10-6-and-python-2-6 65 67 … … 73 75 documentation 74 76 75 pas de diac trique dans ldap77 pas de diacritique dans ldap 76 78 77 79 EVOLUTIONS … … 90 92 * reprise 91 93 92 voici tous les champs:: 93 94 ["cn: ['Adel Ammar (S. Thiria)']", 95 "objectClass: ['inetLocalMailRecipient', 'person', 'organizationalPerson', 'inetOrgPerson', 'loceanPersonne', 'posixAccount', 'top']", 96 "uidNumber: ['36310']", 97 "street: ['LOCEAN']", 98 "uid: ['aalod']", 99 "title: ['http://www.locean-ipsl.upmc.fr/photo.jpg']", 100 "mailLocalAddress: ['aalod@locean-ipsl.upmc.fr']", 101 "postalCode: ['75252 PARIS Cedex 05']", 102 "mail: ['aalod@locean-ipsl.upmc.fr', 'aalod@lodyc.jussieu.fr', 'Ammar.Adel@locean-ipsl.upmc.fr', 'Ammar.Adel@lodyc.jussieu.fr', 'Ammar@lodyc.jussieu.fr', 'Ammar@locean-ipsl.upmc.fr', 'Adel.Ammar@locean-ipsl.upmc.fr', 'Adel.Ammar@lodyc.jussieu.fr']", 103 "postalAddress: ['4 place Jussieu']", 104 "description: ['S. Thiria']", 105 "loginShell: ['/bin/tcsh']", 106 "gidNumber: ['1664']", 107 "employeeNumber: ['44']", 108 "mailForwardingAddress: ['Adel.Ammar@locean-ipsl.upmc.fr']", 109 "loceanAnnuaire: ['44']", 110 "displayName: ['Adel.Ammar']", 111 "roomNumber: ['Bureau XXX, Tour 45']", 112 "loceanPhotoUrl: ['http://www.locean-ipsl.upmc.fr/photo.jpg']", 113 "carLicense: ['Thiria']", 114 "mailHost: ['locean-ipsl.upmc.fr']", 115 "gecos: ['Adel Ammar (S. Thiria)']", 116 "sn: ['Ammar']", 117 "homeDirectory: ['/usr/home/aalod']", 118 "givenName: ['Adel']", 119 "uid: ['abelod']", "objectClass: ['posixAccount', 'person', 'organizationalPerson', 'inetOrgPerson', 'loceanPersonne', 'top', 'inetLocalMailRecipient']", "uidNumber: ['36337']", "street: ['LOCEAN']", 120 94 voici tous les champs: 95 96 .. parsed-literal:: 97 98 ["cn: ['Adel Ammar (S. Thiria)']", 99 "objectClass: ['inetLocalMailRecipient', 'person', 'organizationalPerson', 'inetOrgPerson', 'loceanPersonne', 'posixAccount', 'top']", 100 "uidNumber: ['36310']", 101 "street: ['LOCEAN']", 102 "uid: ['aalod']", 103 "title: ['http://www.locean-ipsl.upmc.fr/photo.jpg']", 104 "mailLocalAddress: ['aalod@locean-ipsl.upmc.fr']", 105 "postalCode: ['75252 PARIS Cedex 05']", 106 "mail: ['aalod@locean-ipsl.upmc.fr', 'aalod@lodyc.jussieu.fr', 'Ammar.Adel@locean-ipsl.upmc.fr', 'Ammar.Adel@lodyc.jussieu.fr', 'Ammar@lodyc.jussieu.fr', 'Ammar@locean-ipsl.upmc.fr', 'Adel.Ammar@locean-ipsl.upmc.fr', 'Adel.Ammar@lodyc.jussieu.fr']", 107 "postalAddress: ['4 place Jussieu']", 108 "description: ['S. Thiria']", 109 "loginShell: ['/bin/tcsh']", 110 "gidNumber: ['1664']", 111 "employeeNumber: ['44']", 112 "mailForwardingAddress: ['Adel.Ammar@locean-ipsl.upmc.fr']", 113 "loceanAnnuaire: ['44']", 114 "displayName: ['Adel.Ammar']", 115 "roomNumber: ['Bureau XXX, Tour 45']", 116 "loceanPhotoUrl: ['http://www.locean-ipsl.upmc.fr/photo.jpg']", 117 "carLicense: ['Thiria']", 118 "mailHost: ['locean-ipsl.upmc.fr']", 119 "gecos: ['Adel Ammar (S. Thiria)']", 120 "sn: ['Ammar']", 121 "homeDirectory: ['/usr/home/aalod']", 122 "givenName: ['Adel']", 123 "uid: ['abelod']", "objectClass: ['posixAccount', 'person', 'organizationalPerson', 'inetOrgPerson', 'loceanPersonne', 'top', 'inetLocalMailRecipient']", "uidNumber: ['36337']", "street: ['LOCEAN']", 124 121 125 - fplod 20110617T080312Z cratos.locean-ipsl.upmc.fr (Linux) 122 126 … … 125 129 - fplod 20110616T144623Z cratos.locean-ipsl.upmc.fr (Linux) 126 130 127 * creation 131 * creation 128 132 cf. http://www.ibm.com/developerworks/aix/library/au-ldap_crud/ 129 133 cf. http://www.packtpub.com/article/python-ldap-applications-ldap-opearations … … 160 164 def readldap(ildap, baseDN, searchScope, searchFilter, is_verbose): 161 165 """ 162 read LPAP 163 164 return people diction nary sn: uid: givenName: mailForwardingAddress: uidNumber166 read LPAP 167 168 return people dictionary sn: uid: givenName: mailForwardingAddress: uidNumber 165 169 """ 166 170 167 171 retrieveAttributes = ['uid', 'sn', 'givenName', 'mailForwardingAddress', 'uidNumber'] 168 172 keys_for_all = [] 169 values_for_all = [] 173 values_for_all = [] 170 174 ldap_result_id = ildap.search_s(baseDN, searchScope, searchFilter, retrieveAttributes) 171 175 for ldap_result_one in ldap_result_id: … … 180 184 181 185 if is_verbose == True: 182 # pour voir la derniere personne ajoutée186 # pour voir la derniere personne ajoutée 183 187 print values_for_all[-1] 184 188 185 # populate dicton nary189 # populate dictonary 186 190 people = dict(itertools.izip(keys_for_all, values_for_all)) 187 191 … … 213 217 #++if ldap.__version__ == '2.3.13' 214 218 #++l = ldap.initialize(ldap_host) 215 #++else 219 #++else 216 220 l = ldap.open(ldap_host) 217 221 218 222 l.protocol_version = ldap.VERSION3 219 223 220 224 baseDN = 'ou=utilisateurs ,dc=locean-ipsl,dc=upmc,dc=fr' 221 225 searchScope = ldap.SCOPE_SUBTREE
Note: See TracChangeset
for help on using the changeset viewer.