Index: trunk/aeres/scripts/aeresrh.py
===================================================================
--- trunk/aeres/scripts/aeresrh.py	(revision 194)
+++ trunk/aeres/scripts/aeresrh.py	(revision 195)
@@ -3,5 +3,7 @@
 
 __docformat__ = 'reStructuredText'
+__revision__ = "$Id$"
 __autodoc__ = ['aeresrh']
+
 
 """
@@ -67,5 +69,6 @@
 append sur ifiles car liste permanent et liste thesard
 
-comment j'ai la liste des gens partis au 30 juin 2012 avec publication (retraite, decès, mutation)
+comment j'ai la liste des gens partis au 30 juin 2012 avec 
+publication (retraite, decès, mutation)
 
 test with real file (encoding, francais, etc)
@@ -97,6 +100,6 @@
 - fplod 20120406
 
-  * tst avec copie de vrai fichier ( ~/Downloads/personnel\ franc\314\247oise.xlsx)
-    dans toto.xsl
+  * tst avec copie de vrai fichier 
+   (fplod@halios:Downloads/personnel\ franc\314\247oise.xlsx) dans toto.xsl
 - fplod 20120405
  
@@ -105,4 +108,5 @@
     thanks to http://www.portailsig.org/content/python-lire-et-ecrire-des-fichiers-microsoft-excel-application-quantum-gis
     and http://scienceoss.com/read-excel-files-from-python/
+
 """
 
@@ -141,7 +145,7 @@
     parser.add_option ('-i', '--ifile',
         help='file to be read',
-	type='string',
+        type='string',
         dest='ifile',
-	default=None,
+        default=None,
         action='store')
 
@@ -195,7 +199,7 @@
     for rownum in range(sh.nrows):
         if sh.row_values(rownum)[0] == "Type d'emploi (EC, Ch, AP)":
-	    titlerow = rownum 
-    if is_verbose == True:
-	    print('titlerow : %d ' % (titlerow))
+            titlerow = rownum 
+    if is_verbose == True:
+        print('titlerow : %d ' % (titlerow))
 
     # deduce first usefull row
@@ -204,38 +208,38 @@
     # detect last usefull row
     uselessrow = []
-    for rownum in range(titlerow,sh.nrows):
+    for rownum in range(titlerow, sh.nrows):
         if sh.row_values(rownum)[0] == '': 
-	    uselessrow.append(rownum)
+            uselessrow.append(rownum)
     lastrow = uselessrow[0]
     if is_verbose == True:
-	    print('lastrow : %d ' % (lastrow))
+        print('lastrow : %d ' % (lastrow))
 
     # detect surname column
     for colnum in range(sh.ncols):
         if sh.col_values(colnum)[titlerow] == 'Nom':
-	    colsurname = colnum
-    if is_verbose == True:
-	    print('colsurname: %d ' % (colsurname))
+            colsurname = colnum
+    if is_verbose == True:
+        print('colsurname: %d ' % (colsurname))
 
     # detect firstname column
     for colnum in range(sh.ncols):
-	if sh.col_values(colnum)[titlerow] == u'Prénom':
-	    colfirstname = colnum
-    if is_verbose == True:
-	    print('colfirstname: %d ' % (colfirstname))
+        if sh.col_values(colnum)[titlerow] == u'Prénom':
+            colfirstname = colnum
+    if is_verbose == True:
+        print('colfirstname: %d ' % (colfirstname))
 
     # detect arrival column
     for colnum in range(sh.ncols):
-	if sh.col_values(colnum)[titlerow] ==  u"Date d'arriv\xe9e dans l'unit\xe9\n(9)":
-	    colarrival = colnum
-    if is_verbose == True:
-	    print('colarrival: %d ' % (colarrival))
+        if sh.col_values(colnum)[titlerow] ==  u"Date d'arriv\xe9e dans l'unit\xe9\n(9)":
+            colarrival = colnum
+    if is_verbose == True:
+        print('colarrival: %d ' % (colarrival))
 
     # detect publi column
     for colnum in range(sh.ncols):
-	if sh.col_values(colnum)[titlerow] ==  u'N\xb0 des 5 productions les plus significatives dans la p\xe9riode \xe9valu\xe9e\n(11)':
-	    colpubli = colnum
-    if is_verbose == True:
-	    print('colpubli: %d ' % (colpubli))
+        if sh.col_values(colnum)[titlerow] ==  u'N\xb0 des 5 productions les plus significatives dans la p\xe9riode \xe9valu\xe9e\n(11)':
+            colpubli = colnum
+    if is_verbose == True:
+        print('colpubli: %d ' % (colpubli))
 
     datemode = 0 
@@ -244,12 +248,12 @@
 
     if is_verbose == True:
-       print(' nb surname %d' % len(surname))
-       print(' surname %s' % surname)
+        print(' nb surname %d' % len(surname))
+        print(' surname %s' % surname)
 
     firstname = sh.col_values(colfirstname)[firstrow:lastrow]
 
     if is_verbose == True:
-       print(' nb firstname %d' % len(firstname))
-       print(' firstname %s' % firstname)
+        print(' nb firstname %d' % len(firstname))
+        print(' firstname %s' % firstname)
 
     temp = sh.col_values(colarrival)[firstrow:lastrow]
@@ -261,15 +265,15 @@
             print('eee : pas de date arrivee colonne %d ' % rownum)
         else:
-            arrival.append(datetime.datetime(*xlrd.xldate_as_tuple(temp[rownum],datemode)))
-
-    if is_verbose == True:
-       print(' nb arrival %d' % len(arrival))
-       print(' arrival %s' % arrival)
+            arrival.append(datetime.datetime(*xlrd.xldate_as_tuple(temp[rownum], datemode)))
+
+    if is_verbose == True:
+        print(' nb arrival %d' % len(arrival))
+        print(' arrival %s' % arrival)
 
     publi = sh.col_values(colpubli)[firstrow:lastrow]
 
     if is_verbose == True:
-       print(' nb publi %d' % len(publi))
-       print(' publi %s' % publi)
+        print(' nb publi %d' % len(publi))
+        print(' publi %s' % publi)
 
     return surname, firstname, arrival, publi
@@ -287,5 +291,5 @@
     ifile = fromcli.ifile
     if fromcli.is_verbose == True:
-       print ('ifile : %s' % (ifile))
+        print ('ifile : %s' % (ifile))
 
     surname, firstname, arrival, publi = readrh(ifile, is_verbose)
@@ -300,10 +304,10 @@
     keys_for_one = ['surname', 'firstname', 'arrival', 'publi']
     for index in range(len(surname_id)):
-        values_for_one=[]
+        values_for_one = []
         values_for_one.append(surname[index])
         values_for_one.append(firstname[index])
         values_for_one.append(arrival[index])
         values_for_one.append(publi[index])
-        values_for_all.append(dict(itertools.izip(keys_for_one,values_for_one)))
+        values_for_all.append(dict(itertools.izip(keys_for_one, values_for_one)))
         keys_for_all.append('{surname_id}_{firstname_id}'.format(surname_id=surname_id[index], firstname_id=firstname_id[index]))
 
@@ -316,5 +320,5 @@
             print ('associated info : %s ' % values_for_all[index])
 
-    people = dict(itertools.izip(keys_for_all,values_for_all))
+    people = dict(itertools.izip(keys_for_all, values_for_all))
 
     if is_verbose == True:
Index: trunk/aeres/scripts/build_firstname_id.py
===================================================================
--- trunk/aeres/scripts/build_firstname_id.py	(revision 194)
+++ trunk/aeres/scripts/build_firstname_id.py	(revision 195)
@@ -50,5 +50,9 @@
 import re
 
-from unidecode import unidecode
+try:
+    from unidecode import unidecode
+except ImportError:
+    print("Failed to import unidecode from any known place")
+    sys.exit(1)
 
 def build_firstname_id(firstname):
Index: trunk/aeres/scripts/build_surname_id.py
===================================================================
--- trunk/aeres/scripts/build_surname_id.py	(revision 194)
+++ trunk/aeres/scripts/build_surname_id.py	(revision 195)
@@ -51,4 +51,10 @@
 import sys
 
+try:
+    from unidecode import unidecode
+except ImportError:
+    print("Failed to import unidecode from any known place")
+    sys.exit(1)
+
 def build_surname_id(surname):
 
@@ -73,6 +79,6 @@
     # convert to str
     surname_str = [str(item) for item in surname]
-    for item in surname:
-        print ('iii : item type %s : %s ' % (item, type(item)))
+    #for item in surname:
+    #    print ('iii : item type %s : %s ' % (item, type(item)))
 
     # remove white space before and after
Index: trunk/aeres/scripts/define_loceanaffectation.py
===================================================================
--- trunk/aeres/scripts/define_loceanaffectation.py	(revision 194)
+++ trunk/aeres/scripts/define_loceanaffectation.py	(revision 195)
@@ -3,4 +3,50 @@
 
 __docformat__ = "restructuredtext en"
+__revision__ = "$Id$"
+
+"""
+===========================
+define_loceanaffectation.py
+===========================
+
+DESCRIPTION
+===========
+
+define affectation
+
+SEE ALSO
+========
+
+EXAMPLES
+========
+
+::
+
+ define_loceanaffectation.py
+
+
+TODO
+====
+
+test
+
+code administration
+
+coding rules (pylint)
+
+verbose
+
+EVOLUTIONS
+==========
+
+$Id$
+
+$URL$
+
+- fplod 20120427
+
+  * header
+
+"""
 
 def define_loceanaffectation():
@@ -29,2 +75,10 @@
 
     return affectation_title, affectation_bibtool
+
+
+# Run main, if called from the command line
+if __name__ == '__main__':
+    title, bibtool = define_loceanaffectation()
+    print(' title : %s , bibtool : %s' % (title,bibtool)) 
+
+
