[cpif] r263 - trunk/backend

svn at argo.es svn at argo.es
Wed Jul 11 22:49:01 CEST 2007


Author: jcea
Date: Wed Jul 11 22:49:00 2007
New Revision: 263

Log:
Soporte last-modified en los objetos estaticos

Modified:
   trunk/backend/database.py
   trunk/backend/upgrade.py

Modified: trunk/backend/database.py
==============================================================================
--- trunk/backend/database.py	(original)
+++ trunk/backend/database.py	Wed Jul 11 22:49:00 2007
@@ -1,7 +1,7 @@
 # $Id$
 
 
-VERSION_DB="2007071101"
+VERSION_DB="2007071103"
 
 from globales import thread_len
 
@@ -114,10 +114,11 @@
                  'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
                  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
     year, month, day, hh, mm, ss, wd, y, z = time.gmtime()
-    s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
+    ts = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
             weekdayname[wd],
             day, monthname[month], year,
             hh, mm, ss)
+    return ts
 
   from durus.persistent_list import PersistentList
   root=conn.get_root()

Modified: trunk/backend/upgrade.py
==============================================================================
--- trunk/backend/upgrade.py	(original)
+++ trunk/backend/upgrade.py	Wed Jul 11 22:49:00 2007
@@ -146,7 +146,7 @@
                  'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
                  'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
     year, month, day, hh, mm, ss, wd, y, z = time.gmtime()
-    s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
+    ts = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
             weekdayname[wd],
             day, monthname[month], year,
             hh, mm, ss)
@@ -157,4 +157,40 @@
         j[0]["last modified"]=ts
     conn.commit()
 
+  if root["version del foro"]=="2007071101" :
+    import time
+    weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+    monthname = [None,
+                 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+                 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+    year, month, day, hh, mm, ss, wd, y, z = time.gmtime()
+    ts = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
+            weekdayname[wd],
+            day, monthname[month], year,
+            hh, mm, ss)
+    print "Actualizando la base de datos: 2007071101 -> 2007071102"
+    root["version del foro"]="2007071102"
+    for i in root["static"].values() :
+      for j in i.values() :
+        j[0]["last modified"]=ts
+    conn.commit()
+
+  if root["version del foro"]=="2007071102" :
+    import time
+    weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+    monthname = [None,
+                 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+                 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+    year, month, day, hh, mm, ss, wd, y, z = time.gmtime()
+    ts = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
+            weekdayname[wd],
+            day, monthname[month], year,
+            hh, mm, ss)
+    print "Actualizando la base de datos: 2007071102 -> 2007071103"
+    root["version del foro"]="2007071103"
+    for i in root["static"].values() :
+      for j,k in i.items() :
+        k[0]["last modified"]=ts
+        i[j]=k # Los items son diccionarios no persistentes, asi que hay que sobreescribir
+    conn.commit()
 



More information about the cpif mailing list