[Scodoc-devel] [SVN] Scolar : [1212] - Verification de la version installee et comparaison a celle distribuee pour

eviennet at lipn.univ-paris13.fr eviennet at lipn.univ-paris13.fr
Mer 20 Mar 10:59:42 CET 2013


Une pièce jointe HTML a été nettoyée...
URL: <https://www-rt.iutv.univ-paris13.fr/pipermail/scodoc-devel/attachments/20130320/f1897433/attachment.html>
-------------- section suivante --------------
Modified: trunk/ZScolar.py
===================================================================
--- trunk/ZScolar.py	2013-03-20 08:38:11 UTC (rev 1211)
+++ trunk/ZScolar.py	2013-03-20 09:59:42 UTC (rev 1212)
@@ -90,6 +90,7 @@
 import sco_page_etud, sco_groups, sco_trombino
 import sco_archives_etud
 import sco_groups_edit
+import sco_up_to_date
 from sco_formsemestre_status import makeMenu
 from VERSION import SCOVERSION, SCONEWS
 
@@ -561,14 +562,18 @@
     # ----------  PAGE ACCUEIL (listes) --------------
     security.declareProtected(ScoView, 'index_html')
     def index_html(self,REQUEST=None, showcodes=0, showlocked=0):
-        "page accueil sco"
+        "Page accueil d\xE9partement (liste des semestres)"
         showlocked=int(showlocked)
         H = []
-        # news
+
+        # News:
         rssicon = self.icons.rssicon_img.tag(title='Flux RSS', border='0') 
         H.append( sco_news.scolar_news_summary_html(self, rssicon=rssicon) )
 
-        # liste de toutes les sessions
+        # Avertissement de mise \xE0 jour:
+        H.append(sco_up_to_date.html_up_to_date_box(self))
+
+        # Liste de toutes les sessions:
         sems = self.Notes.do_formsemestre_list()
         now = time.strftime( '%Y-%m-%d' )
 

Modified: trunk/config/upgrade.sh
===================================================================
--- trunk/config/upgrade.sh	2013-03-20 08:38:11 UTC (rev 1211)
+++ trunk/config/upgrade.sh	2013-03-20 09:59:42 UTC (rev 1212)
@@ -36,9 +36,11 @@
   mode=install  
 fi
 
-SVERSION=$(curl --connect-timeout 5 --silent http://notes.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=$mode\&svn="$SVNVERSION"\&sn="$SN")
-if [ ! -z "$SVERSION" ]; then
+SVERSION=$(curl --fail --connect-timeout 5 --silent http://notes.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=$mode\&svn="$SVNVERSION"\&sn="$SN")
+if [ $? == 0 ]; then
   echo "${SVERSION}" > "${SCODOC_DIR}"/config/scodoc.sn
+else
+  echo 'Warning: cannot connect to scodoc release server'
 fi
 
 # Check that no Zope "access" file has been forgotten in the way:

Modified: trunk/sco_portal_apogee.py
===================================================================
--- trunk/sco_portal_apogee.py	2013-03-20 08:38:11 UTC (rev 1211)
+++ trunk/sco_portal_apogee.py	2013-03-20 09:59:42 UTC (rev 1212)
@@ -5,7 +5,7 @@
 #
 # Gestion scolarite IUT
 #
-# Copyright (c) 2001 - 2011 Emmanuel Viennet.  All rights reserved.
+# Copyright (c) 2001 - 2013 Emmanuel Viennet.  All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,12 +28,7 @@
 """Liaison avec le portail ENT (qui donne acc\xE8s aux infos Apog\xE9e)
 """
 
-import urllib, urllib2, xml, xml.dom.minidom
-import socket
-
-from notes_log import log
 from sco_utils import *
-from SuppressAccents import suppression_diacritics
 
 def has_portal(context):
     "True if we are connected to a portal"
@@ -96,22 +91,9 @@
     if not portal_url:
         return []
     req = portal_url + 'getEtud.php?' + urllib.urlencode(args.items())
-    doc = query_portal(req)
+    doc = query_portal(req) # sco_utils
     return xml_to_list_of_dicts(doc, req=req)
 
-def query_portal(req):
-    log('query_portal: %s' % req )
-    # band aid for Python 2.4: must use GLOBAL socket timeout
-    orig_timeout = socket.getdefaulttimeout()
-    try:        
-        socket.setdefaulttimeout(3) #  seconds / request
-        f = urllib2.urlopen(req) # XXX ajouter timeout (en Python 2.6 !)
-    except:
-        log("query_apogee_portal: can't connect to Apogee portal")
-        return ''
-    socket.setdefaulttimeout(orig_timeout)
-    return f.read()
-
 def xml_to_list_of_dicts(doc, req=None):
     if not doc:
         return []

Modified: trunk/sco_preferences.py
===================================================================
--- trunk/sco_preferences.py	2013-03-20 08:38:11 UTC (rev 1211)
+++ trunk/sco_preferences.py	2013-03-20 09:59:42 UTC (rev 1212)
@@ -5,7 +5,7 @@
 #
 # Gestion scolarite IUT
 #
-# Copyright (c) 2001 - 2012 Emmanuel Viennet.  All rights reserved.
+# Copyright (c) 2001 - 2013 Emmanuel Viennet.  All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by

Modified: trunk/sco_utils.py
===================================================================
--- trunk/sco_utils.py	2013-03-20 08:38:11 UTC (rev 1211)
+++ trunk/sco_utils.py	2013-03-20 09:59:42 UTC (rev 1212)
@@ -36,9 +36,15 @@
 from types import StringType, IntType, FloatType, UnicodeType, ListType, TupleType
 import operator, bisect
 import thread
-import urllib, time, datetime, cgi
+import urllib
+import urllib2
+import socket
+import xml.sax.saxutils
+import xml, xml.dom.minidom
+import time, datetime, cgi
+
 from sets import Set
-import xml.sax.saxutils
+
 from PIL import Image as PILImage
 
 # XML generation package (apt-get install jaxml)
@@ -590,3 +596,20 @@
         # Helps debugging 
         log('sort_dates( %s )' % L )
         raise
+
+
+def query_portal(req, msg='Apogee', timeout=3):
+    """retreive external data using http request
+    (used to connect to Apogee portal, or ScoDoc server)
+    """
+    log('query_portal: %s' % req )
+    # band aid for Python 2.4: must use GLOBAL socket timeout
+    orig_timeout = socket.getdefaulttimeout()
+    try:        
+        socket.setdefaulttimeout(timeout) #  seconds / request
+        f = urllib2.urlopen(req) # XXX ajouter timeout (en Python 2.6 !)
+    except:
+        log("query_portal: can't connect to %s" % msg)
+        return ''
+    socket.setdefaulttimeout(orig_timeout)
+    return f.read()

Modified: trunk/static/css/scodoc.css
===================================================================
--- trunk/static/css/scodoc.css	2013-03-20 08:38:11 UTC (rev 1211)
+++ trunk/static/css/scodoc.css	2013-03-20 09:59:42 UTC (rev 1212)
@@ -1,5 +1,5 @@
 /* # -*- mode: css -*- 
-           ScoDoc, (c) Emmanuel Viennet 1998 - 2012
+           ScoDoc, (c) Emmanuel Viennet 1998 - 2013
  */
 
 html,body {
@@ -1876,4 +1876,22 @@
 }
 div.othersemlist input {
    margin-left: 20px;
-}
\ No newline at end of file
+}
+
+
+div.update_warning {
+    border: 1px solid red;
+    background-color: rgb(250,220,220);
+    margin: 3ex;
+    padding-left: 1ex;
+    padding-right: 1ex;
+    padding-bottom: 1ex;
+}
+div.update_warning span:before {
+    content: url(/ScoDoc/static/icons/warning_img.png);
+    vertical-align: -80%;  
+}
+div.update_warning_sub {
+    font-size: 80%;
+    padding-left: 8ex;
+}


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