damned-lies r1324 - in trunk: . languages stats stats/conf



Author: claudep
Date: Thu Jan  8 11:09:59 2009
New Revision: 1324
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1324&view=rev

Log:
2009-01-08  Claude Paroz  <claude 2xlibre net>

	* settings_sample.py:
	* stats/conf/*: Removed stats custom settings (merged in
	settings_sample.py).
	* stats/models.py:
	* stats/utils.py:
	* stats/views.py:
	* languages/views.py:
	* urls.py:
	* README: Removed references to stats/conf/settings.py.

Removed:
   trunk/stats/conf/
Modified:
   trunk/ChangeLog
   trunk/README
   trunk/languages/views.py
   trunk/settings_sample.py
   trunk/stats/models.py
   trunk/stats/utils.py
   trunk/stats/views.py
   trunk/urls.py

Modified: trunk/README
==============================================================================
--- trunk/README	(original)
+++ trunk/README	Thu Jan  8 11:09:59 2009
@@ -1,7 +1,8 @@
 This is a re-implementation of the Damned-Lies application
 in a Django app. Damned-Lies has been originally written by
 Danilo Segan (danilo gnome org). This implementation has been
-written by Claude Paroz (claude 2xlibre net).
+written by Claude Paroz (claude 2xlibre net) and StÃphane
+Raimbault (.
 
 The former XML files (modules, releases, people, translation
 teams) have been replaced by a database.
@@ -16,7 +17,7 @@
 
 1 - Django 1.0.X
 
-2 - Python 2.4 (for set built-in).
+2 - Python 2.5 (for hashlib module).
 
 3 - [Optional] Django Evolution is an extension to Django that allows
     you to track changes in your models over time, and to update the
@@ -36,15 +37,12 @@
 Installation
 ============
 
-1 - Rename settings_sample.py in settings.py
+1 - Rename settings_sample.py in settings.py and review settings
+    (please refer to Database configuration below for more informations).
 
-2 - Review and fill in settings in stats/conf/settings_sample.py and
-    rename it to settings.py (please refer to Database configuration
-    below for more informations).
+2 - Run 'python manage.py syncdb'
 
-3 - Run 'python manage.py syncdb'
-
-4 - Configure Sites in admin interface to define the 'View on site'
+3 - Configure Sites in admin interface to define the 'View on site'
     link.
 
 OpenID support

Modified: trunk/languages/views.py
==============================================================================
--- trunk/languages/views.py	(original)
+++ trunk/languages/views.py	Thu Jan  8 11:09:59 2009
@@ -26,7 +26,7 @@
 from django.utils.translation import ugettext as _
 from django.template import RequestContext
 from django.http import HttpResponse, HttpResponseRedirect
-from stats.conf import settings
+from django.conf import settings
 from common import utils
 from languages.models import Language
 from stats.models import Release

Modified: trunk/settings_sample.py
==============================================================================
--- trunk/settings_sample.py	(original)
+++ trunk/settings_sample.py	Thu Jan  8 11:09:59 2009
@@ -17,9 +17,6 @@
 
 MANAGERS = ADMINS
 
-SERVER_EMAIL = 'gnomeweb gnome org'
-EMAIL_SUBJECT_PREFIX = '[Damned Lies] '
-
 DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
 DATABASE_NAME = os.path.join(PROJECT_PATH,'database.db')            # Or path to database file if using sqlite3.
 DATABASE_USER = ''             # Not used with sqlite3.
@@ -41,8 +38,10 @@
 EMAIL_HOST = 'localhost'
 EMAIL_HOST_USER = ''
 EMAIL_HOST_PASSWORD = ''
-EMAIL_SUBJECT_PREFIX = '[DL]'
-SERVER_EMAIL = 'server l10n gnome org'
+EMAIL_SUBJECT_PREFIX = '[Damned Lies]'
+SERVER_EMAIL = 'gnomeweb gnome org'
+# When in STRINGFREEZE, where to send notifications (gnome-i18n gnome org) on any POT changes
+NOTIFICATIONS_TO = ['gnome-i18n gnome org']
 
 # Local time zone for this installation. Choices can be found here:
 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
@@ -70,11 +69,15 @@
 # Examples: "http://media.lawrence.com";, "http://example.com/media/";
 MEDIA_URL = '/media/'
 
+# Local directory path for VCS checkout
+SCRATCHDIR = ""
+POTDIR = os.path.join(SCRATCHDIR, "POT")
 # By default, Django stores files locally, using the MEDIA_ROOT and MEDIA_URL settings
 UPLOAD_DIR = 'upload'
 UPLOAD_BACKUP_DIR = 'upload-backup'
 FILE_UPLOAD_PERMISSIONS = 0600
 
+
 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
 # trailing slash.
 # Examples: "http://foo.com/media/";, "/media/".

Modified: trunk/stats/models.py
==============================================================================
--- trunk/stats/models.py	(original)
+++ trunk/stats/models.py	Thu Jan  8 11:09:59 2009
@@ -25,7 +25,7 @@
 from time import tzname
 from django.db import models, connection
 from django.utils.translation import ungettext, ugettext as _, ugettext_noop
-from stats.conf import settings
+from django.conf import settings
 from stats import utils
 import potdiff
 

Modified: trunk/stats/utils.py
==============================================================================
--- trunk/stats/utils.py	(original)
+++ trunk/stats/utils.py	Thu Jan  8 11:09:59 2009
@@ -24,9 +24,10 @@
 from subprocess import Popen, PIPE, STDOUT
 
 from django.utils.translation import ugettext as _, ugettext_noop
+from django.contrib.sites.models import Site
 from django.core.mail import send_mail
 from django.core.files.base import File
-from stats.conf import settings
+from django.conf import settings
 
 STATUS_OK = 0
 
@@ -340,8 +341,9 @@
 
 def notify_list(out_domain, diff):
     """Send notification about string changes described in diff."""
+    current_site = Site.objects.get_current()
     text = u"""This is an automatic notification from status generation scripts on:
-%(ourweb)s.
+http://%(ourweb)s.
 
 There have been following string additions to module '%(module)s':
 
@@ -350,12 +352,12 @@
 Note that this doesn't directly indicate a string freeze break, but it
 might be worth investigating.
 """ % { 'module' : out_domain,
-    'ourweb' : settings.WHEREAREWE,
+    'ourweb' : current_site.domain,
     'potdiff' : "\n    ".join(diff).decode('utf-8') }
 
     send_mail(subject="String additions to '%s'" % (out_domain),
               message=text,
-              from_email="GNOME Status Pages <%s>" % (settings.WHOAREWE),
+              from_email="GNOME Status Pages <%s>" % (settings.SERVER_EMAIL),
               recipient_list=settings.NOTIFICATIONS_TO)
 
 def url_join(base, *args):

Modified: trunk/stats/views.py
==============================================================================
--- trunk/stats/views.py	(original)
+++ trunk/stats/views.py	Thu Jan  8 11:09:59 2009
@@ -26,7 +26,6 @@
 
 from stats.models import Statistics, Module, Branch, Category, Release
 from stats.forms import ModuleBranchForm
-from stats.conf import settings
 from stats import utils
 
 MIME_TYPES = {'json': 'application/json',

Modified: trunk/urls.py
==============================================================================
--- trunk/urls.py	(original)
+++ trunk/urls.py	Thu Jan  8 11:09:59 2009
@@ -1,6 +1,5 @@
 from django.conf.urls.defaults import *
 from django.conf import settings
-from stats.conf import settings as stats_settings
 from django.contrib import admin
 
 admin.autodiscover()
@@ -42,5 +41,5 @@
         (r'^media/(?P<path>.*)$', 'django.views.static.serve',
          {'document_root': settings.MEDIA_ROOT}),
         (r'^POT/(?P<path>.*)$', 'django.views.static.serve',
-         {'document_root': stats_settings.POTDIR}),
+         {'document_root': settings.POTDIR}),
     )



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]