[Scodoc-devel] [SVN] Scolar : [1221] Modifications (en cours) pour python2.6.

eviennet at lipn.univ-paris13.fr eviennet at lipn.univ-paris13.fr
Sam 23 Mar 18:11:46 CET 2013


Une pièce jointe HTML a été nettoyée...
URL: <https://www-rt.iutv.univ-paris13.fr/pipermail/scodoc-devel/attachments/20130323/1ed1a60d/attachment.html>
-------------- section suivante --------------
Modified: branches/ScoDoc7/VERSION.py
===================================================================
--- branches/ScoDoc7/VERSION.py	2013-03-23 16:58:53 UTC (rev 1220)
+++ branches/ScoDoc7/VERSION.py	2013-03-23 17:11:46 UTC (rev 1221)
@@ -1,7 +1,7 @@
 # -*- mode: python -*-
 # -*- coding: iso8859-15 -*-
 
-SCOVERSION = "6.5"
+SCOVERSION = "7.0a"
 
 SCONAME = "ScoDoc"
 

Modified: branches/ScoDoc7/ZScolar.py
===================================================================
--- branches/ScoDoc7/ZScolar.py	2013-03-23 16:58:53 UTC (rev 1220)
+++ branches/ScoDoc7/ZScolar.py	2013-03-23 17:11:46 UTC (rev 1221)
@@ -368,7 +368,7 @@
     def about(self, REQUEST):
         "version info"
         H = [ """<h2>Syst\xE8me de gestion scolarit\xE9</h2>
-        <p>© Emmanuel Viennet 1997-2012</p>
+        <p>© Emmanuel Viennet 1997-2013</p>
         <p>Version %s (subversion %s)</p>
         """ % (SCOVERSION, get_svn_version(file_path)) ]
         H.append('<p>Logiciel libre \xE9crit en <a href="http://www.python.org">Python</a>.</p><p>Utilise <a href="http://www.reportlab.org/">ReportLab</a> pour g\xE9n\xE9rer les documents PDF, et <a href="http://sourceforge.net/projects/pyexcelerator">pyExcelerator</a> pour le traitement des documents Excel.</p>')

Modified: branches/ScoDoc7/ZopeProducts/exUserFolder/AuthSources/__init__.py
===================================================================
--- branches/ScoDoc7/ZopeProducts/exUserFolder/AuthSources/__init__.py	2013-03-23 16:58:53 UTC (rev 1220)
+++ branches/ScoDoc7/ZopeProducts/exUserFolder/AuthSources/__init__.py	2013-03-23 17:11:46 UTC (rev 1221)
@@ -20,28 +20,28 @@
 # Author: Andrew Milton <akm at theinternet.com.au>
 # $Id: __init__.py,v 1.1 2004/11/10 14:15:34 akm Exp $
 
-import etcAuthSource
-import httpsAuthSource
-import mysqlAuthSource
+#import etcAuthSource
+#import httpsAuthSource
+#import mysqlAuthSource
 import pgAuthSource
-import pgAuthSourceAlt
-import radiusAuthSource
-import smbAuthSource
-import usAuthSource
-import zodbAuthSource
-import zodbBTreeAuthSource
+#import pgAuthSourceAlt
+#import radiusAuthSource
+#import smbAuthSource
+#import usAuthSource
+#import zodbAuthSource
+#import zodbBTreeAuthSource
 
 #
 # These have special requirements for external libraries
 # that my not be present.
 #
 
-try:
-	import nisAuthSource
-except:
-	pass
+# try:
+# 	import nisAuthSource
+# except:
+# 	pass
 
-try:
-	import LDAPAuthSource
-except:
-	pass
+# try:
+# 	import LDAPAuthSource
+# except:
+# 	pass

Modified: branches/ScoDoc7/ZopeProducts/exUserFolder/exUserFolder.py
===================================================================
--- branches/ScoDoc7/ZopeProducts/exUserFolder/exUserFolder.py	2013-03-23 16:58:53 UTC (rev 1220)
+++ branches/ScoDoc7/ZopeProducts/exUserFolder/exUserFolder.py	2013-03-23 17:11:46 UTC (rev 1221)
@@ -92,7 +92,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-import Globals, App.Undo, socket, os, string, sha, whrandom, sys, zLOG
+import Globals, App.Undo, socket, os, string, sha, random, sys, zLOG
 
 from Globals import DTMLFile, PersistentMapping
 from string import join,strip,split,lower,upper,find
@@ -123,6 +123,9 @@
 
 from AccessControl import Unauthorized
 
+class LoginRequired(Exception):
+    """Login required"""
+    pass
 
 
 # If there is no NUG Product just define a dummy class
@@ -966,7 +969,7 @@
 				response.expireCookie('__aca', path='/')
 			if reason_code:
 				request.set('authFailedCode', reason_code)
-			raise 'LoginRequired', self.docLogin(self, request)
+			raise LoginRequired(self.docLogin(self, request))
 		else:
 			zLOG.LOG('exUserFolder', zLOG.DEBUG, 'not raising LoginRequired for %s' % reason_code)
 
@@ -1038,7 +1041,7 @@
 			c=decodestring(c)
 		except:
 			response.expireCookie('__ac', path='/')
-			raise 'LoginRequired', self.docLogin(self, request)
+			raise LoginRequired(self.docLogin(self, request))
 		
 		name,password=tuple(split(c, ':', 1))
 		return name, password
@@ -1052,7 +1055,7 @@
 			response.expireCookie('__aca', path='/')
 			response.expireCookie('__ac', path='/')	# Precaution
 			response.flush()
-			raise 'LoginRequired', self.docLogin(self, request)
+			raise LoginRequired(self.docLogin(self, request))
 
 		u = self.cache_getCookieCacheUser(c)
 		if u:
@@ -1061,7 +1064,7 @@
 		response.expireCookie('__aca', path='/')
 		response.expireCookie('__ac', path='/')	# Precaution
 		response.flush()
-		raise 'LoginRequired', self.docLogin(self, request)
+		raise LoginRequired(self.docLogin(self, request))
 
 	def setBasicCookie(self, name, password, request, response):
 		token='%s:%s' % (name, password)
@@ -1073,7 +1076,7 @@
 	def setAdvancedCookie(self, name, password, request, response):
 		xufid = self._p_oid
 		hash = encodestring(sha.new('%s%s%f%f%s'%(
-			name, password, time(), whrandom.random(), str(request))).digest())
+			name, password, time(), random.random(), str(request))).digest())
 		token=quote(hash)
 		response.setCookie('__aca', token, path='/')
 		response.flush()

Modified: branches/ScoDoc7/config/install_debian6.sh
===================================================================
--- branches/ScoDoc7/config/install_debian6.sh	2013-03-23 16:58:53 UTC (rev 1220)
+++ branches/ScoDoc7/config/install_debian6.sh	2013-03-23 17:11:46 UTC (rev 1221)
@@ -145,7 +145,7 @@
 #       1.0.3 idem (voir misc/testpydot.py)
 echo '\nInstallation de pydot\n'
 (cd /tmp; tar xfz $SCODOC_DIR/config/softs/pydot-0.9.10.tar.gz)
-(cd /tmp/pydot-0.9.10;  /usr/bin/python2.4 setup.py install)
+(cd /tmp/pydot-0.9.10;  $PYTHON setup.py install)
 
 # ------------ PYEXCELERATOR
 echo
@@ -153,7 +153,7 @@
 echo
 
 (cd /tmp; tar xfz $SCODOC_DIR/config/softs/pyExcelerator-0.6.3a.patched.tgz)
-(cd /tmp/pyExcelerator-0.6.3a.patched; /usr/bin/python2.4 setup.py install)
+(cd /tmp/pyExcelerator-0.6.3a.patched; $PYTHON setup.py install)
 
 echo 'Done.'
 

Modified: branches/ScoDoc7/config/postupgrade.py
===================================================================
--- branches/ScoDoc7/config/postupgrade.py	2013-03-23 16:58:53 UTC (rev 1220)
+++ branches/ScoDoc7/config/postupgrade.py	2013-03-23 17:11:46 UTC (rev 1221)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.4
+#!/usr/bin/env python2.6
 
 """
 ScoDoc post-upgrade script.

Added: branches/ScoDoc7/config/upgrade-to-scodoc7.sh
===================================================================
--- branches/ScoDoc7/config/upgrade-to-scodoc7.sh	                        (rev 0)
+++ branches/ScoDoc7/config/upgrade-to-scodoc7.sh	2013-03-23 17:11:46 UTC (rev 1221)
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# Upgrade ScoDoc installation from ScoDoc 6 to ScoDoc 7
+#   
+# This script should be runned as root (with scodoc stopped)
+#
+
+# E. Viennet, march 2013
+
+if [ -e /opt/scodoc/upgraded_to_v7 ]
+then
+ exit 0
+fi
+
+# ensure we are stopped:
+/etc/init.d/scodoc stop 
+
+
+# Add some missing linux packages:
+apt-get update && apt-get dist-upgrade
+apt-get install python-psycopg2
+
+
+# Upgrade Scodoc...
+cd /tmp
+
+# Get archive:
+
+XXXX tests XXXX
+
+#curl --fail -O http://www-l2ti.univ-paris13.fr/~viennet/ScoDoc/builds/scodoc7-upgrade.tgz
+#if [ $? != 0 ]; then
+#  echo "Erreur: echec du telechargement de la mise a jour vers ScoDoc 7"
+#  exit 1
+#fi
+
+# Open and place directories
+tar xfz scodoc7-upgrade.tgz
+mv zope213 /opt
+mv scodoc7 /opt
+
+# Move current scodoc dirs to new tree:
+for d in var log Products
+do
+   echo "Moving ScoDoc $d to new tree"
+   mv "/opt/scodoc/instance/$d" /opt/scodoc7/
+done
+
+echo "Old scodoc files moved to /opt/scodoc6"
+mv /opt/scodoc /opt/scodoc6
+mv /opt/scodoc7 scodoc
+
+# done
+touch /opt/scodoc/upgraded_to_v7
+
+echo "Upgrade to ScoDoc 7 completed"

Modified: branches/ScoDoc7/sco_utils.py
===================================================================
--- branches/ScoDoc7/sco_utils.py	2013-03-23 16:58:53 UTC (rev 1220)
+++ branches/ScoDoc7/sco_utils.py	2013-03-23 17:11:46 UTC (rev 1221)
@@ -49,7 +49,8 @@
 
 # XML generation package (apt-get install jaxml)
 import jaxml
-import simplejson as json # Attention: ceci pour Python 2.4 (ou 2.5)
+# import simplejson as json # Attention: ceci pour Python 2.4 (ou 2.5)
+import json
 from SuppressAccents import suppression_diacritics
 from sco_exceptions import *
 from sco_permissions import *


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