[Scodoc-devel] [SVN] Scolar : [1288] - Ajout genre (M.

eviennet at lipn.univ-paris13.fr eviennet at lipn.univ-paris13.fr
Jeu 21 Nov 22:49:55 CET 2013


Une pièce jointe HTML a été nettoyée...
URL: <https://www-rt.iutv.univ-paris13.fr/pipermail/scodoc-devel/attachments/20131121/d80fac4d/attachment.html>
-------------- section suivante --------------
Modified: branches/ScoDoc7/ImportScolars.py
===================================================================
--- branches/ScoDoc7/ImportScolars.py	2013-11-21 16:44:53 UTC (rev 1287)
+++ branches/ScoDoc7/ImportScolars.py	2013-11-21 21:49:55 UTC (rev 1288)
@@ -256,7 +256,7 @@
                     try:
                         val = scolars.normalize_sexe(val)
                     except:
-                        raise ScoValueError("valeur invalide pour 'SEXE' (doit etre 'MR' ou 'MME' ou 'H' ou 'F', pas '%s') ligne %d, colonne %s" % (val, linenum, titleslist[i]))
+                        raise ScoValueError("valeur invalide pour 'SEXE' (doit etre 'M' ou 'MME' ou 'H' ou 'F', pas '%s') ligne %d, colonne %s" % (val, linenum, titleslist[i]))
                 # Excel date conversion:
                 if titleslist[i].lower() == 'date_naissance':
                     if val:

Modified: branches/ScoDoc7/ZScolar.py
===================================================================
--- branches/ScoDoc7/ZScolar.py	2013-11-21 16:44:53 UTC (rev 1287)
+++ branches/ScoDoc7/ZScolar.py	2013-11-21 21:49:55 UTC (rev 1288)
@@ -37,7 +37,6 @@
 from zipfile import ZipFile
 import thread
 import psycopg2
-import testencoding
 
 # Zope modules:
 from OFS.SimpleItem import Item # Basic zope object
@@ -229,9 +228,6 @@
             DeptRoles.append( role_name )
         return DeptRoles
 
-    security.declareProtected(ScoView, 'testencoding')
-    testencoding = testencoding.testencoding
-
     security.declareProtected(ScoView, 'essaiform')
     def essaiform(self,REQUEST=None):
         """essai autocompletion"""

Modified: branches/ScoDoc7/notes_log.py
===================================================================
--- branches/ScoDoc7/notes_log.py	2013-11-21 16:44:53 UTC (rev 1287)
+++ branches/ScoDoc7/notes_log.py	2013-11-21 21:49:55 UTC (rev 1288)
@@ -19,11 +19,16 @@
 class _logguer:
     def __init__(self):
         self.file = None
+        self.directory = None
         self.set_log_directory( DEFAULT_LOG_DIR )
         
     def set_log_directory(self, directory):
+        if self.directory != directory and self.file:
+            # changing directory when a log is already open: close it
+            self.file.close()
+            self.file = None
         self.directory = directory
-
+    
     def _open(self):
         if LOG_FILENAME:
             path = os.path.join( self.directory, LOG_FILENAME )

Modified: branches/ScoDoc7/sco_excel.py
===================================================================
--- branches/ScoDoc7/sco_excel.py	2013-11-21 16:44:53 UTC (rev 1287)
+++ branches/ScoDoc7/sco_excel.py	2013-11-21 21:49:55 UTC (rev 1288)
@@ -540,7 +540,7 @@
         n += 1
         li += 1
         ws0.write(li, 0, n, style1b)
-        nomprenom = t['nom'] + ' ' + t['prenom'].lower().capitalize()
+        nomprenom = t['sexe'] + ' '+ t['nom'] + ' ' + t['prenom'].lower().capitalize()
         style_nom = style2t3
         if with_paiement:
             paie = t.get('paiementinscription', None)

Modified: branches/ScoDoc7/sco_utils.py
===================================================================
--- branches/ScoDoc7/sco_utils.py	2013-11-21 16:44:53 UTC (rev 1287)
+++ branches/ScoDoc7/sco_utils.py	2013-11-21 21:49:55 UTC (rev 1288)
@@ -376,7 +376,6 @@
 
 def suppress_accents(s):
     "s is an ordinary string, encoding given by SCO_ENCODING"
-    log('s=%s'%str(s))    
     return str(suppression_diacritics(unicode(s, SCO_ENCODING)))
 
 def make_filename(name):

Modified: branches/ScoDoc7/scolars.py
===================================================================
--- branches/ScoDoc7/scolars.py	2013-11-21 16:44:53 UTC (rev 1287)
+++ branches/ScoDoc7/scolars.py	2013-11-21 21:49:55 UTC (rev 1288)
@@ -121,7 +121,7 @@
     if sexe == 'mr':
         return 'M.'
     else:
-        return sexe.capitalize()
+        return 'Mme'
 
 def normalize_sexe(sexe):
     "returns 'MR' ou 'MME'"


Plus d'informations sur la liste de diffusion Scodoc-devel