correct warnings about timezones, remove dependance on pytz V01.11
authorymh <ymh.work@gmail.com>
Wed, 13 Jun 2012 15:04:18 +0200
changeset 665 f4fed46efbde
parent 664 9392a0440e51
child 666 b89c0b75b07d
correct warnings about timezones, remove dependance on pytz
src/ldt/ldt/__init__.py
src/ldt/ldt/api/ldt/handlers.py
src/ldt/ldt/ldt_utils/stat.py
src/ldt/ldt/ldt_utils/utils.py
virtualenv/res/lib/lib_create_env.py
virtualenv/res/src/pytz.tar.bz2
virtualenv/web/res/res_create_env.py
web/ldtplatform/settings.py
--- a/src/ldt/ldt/__init__.py	Mon Jun 11 19:53:13 2012 +0200
+++ b/src/ldt/ldt/__init__.py	Wed Jun 13 15:04:18 2012 +0200
@@ -1,4 +1,4 @@
-VERSION = (1, 10, 0, "final", 0)
+VERSION = (1, 11, 0, "final", 0)
 
 
 def get_version():
--- a/src/ldt/ldt/api/ldt/handlers.py	Mon Jun 11 19:53:13 2012 +0200
+++ b/src/ldt/ldt/api/ldt/handlers.py	Wed Jun 13 15:04:18 2012 +0200
@@ -44,8 +44,6 @@
 
 class AnnotationHandler(BaseHandler):
     allowed_methods = ('PUT',)
-    model = Project
-    
     
     @require_extended
     def update(self, request, project_id):
--- a/src/ldt/ldt/ldt_utils/stat.py	Mon Jun 11 19:53:13 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/stat.py	Wed Jun 13 15:04:18 2012 +0200
@@ -1,7 +1,7 @@
 from django.conf import settings #@UnresolvedImport
 from ldt.ldt_utils.models import Segment, ContentStat, POL_INDICES
 import datetime
-import pytz
+from django.utils import timezone
 
 def update_stat_content(content):
     
@@ -18,7 +18,7 @@
 
     pol_stats = [0]*len(POL_INDICES)
     
-    min_ts = datetime.datetime.min.replace(tzinfo=pytz.utc)
+    min_ts = datetime.datetime.min.replace(tzinfo=timezone.utc)
     min_update_ts = min_ts #@UndefinedVariable
     
     for segment in segments:
@@ -69,7 +69,7 @@
     
     contentstat, created = ContentStat.objects.get_or_create(content=content) #@UnusedVariable @UndefinedVariable
     contentstat.annotation_volume = buckets
-    contentstat.last_annotated = datetime.datetime.now() #@UndefinedVariable
+    contentstat.last_annotated = timezone.now()
       
     contentstat.save()        
 
--- a/src/ldt/ldt/ldt_utils/utils.py	Mon Jun 11 19:53:13 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/utils.py	Wed Jun 13 15:04:18 2012 +0200
@@ -296,7 +296,7 @@
         return polemics
     
     def __del__(self):
-       self.save()
+        self.save()
 
 def create_ldt(project, user, cuttings=[]):
     """create xml"""
--- a/virtualenv/res/lib/lib_create_env.py	Mon Jun 11 19:53:13 2012 +0200
+++ b/virtualenv/res/lib/lib_create_env.py	Wed Jun 13 15:04:18 2012 +0200
@@ -36,7 +36,6 @@
     'SSH': {'setup': 'ssh', 'url':'http://pypi.python.org/packages/source/s/ssh/ssh-1.7.14.tar.gz#md5=4cdd0549ef4699bd67b96264d3b21427', 'local':'ssh-1.7.14.tar.gz'},
     'FABRIC': {'setup': 'fabric', 'url':'https://github.com/fabric/fabric/tarball/1.4.2', 'local':'fabric-1.4.2.tar.gz'},
     'MERCURIAL': {'setup': 'mercurial', 'url':'http://mercurial.selenic.com/release/mercurial-2.2.2.tar.gz', 'local':'mercurial-2.2.2.tar.gz'},
-    'PYTZ': {'setup':'pytz', 'url':'http://pypi.python.org/packages/source/p/pytz/pytz-2012c.tar.bz2', 'local':'pytz.tar.bz2'},
 }
 
 if system_str == 'Windows':
Binary file virtualenv/res/src/pytz.tar.bz2 has changed
--- a/virtualenv/web/res/res_create_env.py	Mon Jun 11 19:53:13 2012 +0200
+++ b/virtualenv/web/res/res_create_env.py	Wed Jun 13 15:04:18 2012 +0200
@@ -22,7 +22,6 @@
     ])
 
 INSTALLS.extend([ #(key,method, option_str, dict_extra_env)
-    ('PYTZ', 'pip', None, None),
     ('SOUTH', 'pip', None, None),
     ('PIL', 'easy_install', None, None), 
     ('DJANGO','pip', None, None),
--- a/web/ldtplatform/settings.py	Mon Jun 11 19:53:13 2012 +0200
+++ b/web/ldtplatform/settings.py	Wed Jun 13 15:04:18 2012 +0200
@@ -29,7 +29,7 @@
 # although not all choices may be available on all operating systems.
 # If running in a Windows environment this must be set to the same as your
 # system time zone.
-TIME_ZONE = 'Europe/Paris'
+TIME_ZONE = 'UTC'
 
 # Language code for this installation. All choices can be found here:
 # http://www.i18nguy.com/unicode/language-identifiers.html