From b4cf5bbafdda1b8f8fb4f51e6c961ffbbfe992d1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 27 Mar 2013 10:10:08 -0400 Subject: Pull references to Arch Linux in code into BRANDING_ variables in settings This does not include templates --- devel/views.py | 5 +++-- feeds.py | 9 +++++---- packages/management/commands/signoff_report.py | 3 ++- packages/views/flag.py | 2 +- public/views.py | 6 +++--- settings.py | 5 +++++ 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/devel/views.py b/devel/views.py index d2ce65db..7be3dc17 100644 --- a/devel/views.py +++ b/devel/views.py @@ -6,6 +6,7 @@ from string import ascii_letters, digits import time from django import forms +from django.conf import settings from django.http import HttpResponseRedirect from django.contrib.auth.decorators import \ login_required, permission_required, user_passes_test @@ -319,9 +320,9 @@ class NewUserForm(forms.ModelForm): 'password': password, }) - send_mail("Your new archweb account", + send_mail("Your new "+settings.BRANDING_APPNAME+" account", template.render(ctx), - 'Arch Website Notification ', + settings.BRANDING_EMAIL, [user.email], fail_silently=False) diff --git a/feeds.py b/feeds.py index ee856f62..9a5e2777 100644 --- a/feeds.py +++ b/feeds.py @@ -1,6 +1,7 @@ import hashlib import pytz +from django.conf import settings from django.contrib.sites.models import Site from django.contrib.syndication.views import Feed from django.db.models import Q @@ -68,7 +69,7 @@ class PackageFeed(Feed): return obj def title(self, obj): - s = 'Arch Linux: Recent package updates' + s = settings.BRANDING_DISTRONAME+': Recent package updates' if 'repo' in obj: s += ' (%s [%s])' % (obj['arch'].name, obj['repo'].name.lower()) elif 'arch' in obj: @@ -76,7 +77,7 @@ class PackageFeed(Feed): return s def description(self, obj): - s = 'Recently updated packages in the Arch Linux package repositories' + s = 'Recently updated packages in the '+settings.BRANDING_DISTRONAME+' package repositories' if 'arch' in obj: s += ' for the \'%s\' architecture' % obj['arch'].name.lower() if not obj['arch'].agnostic: @@ -117,9 +118,9 @@ def news_last_modified(request, *args, **kwargs): class NewsFeed(Feed): feed_type = GuidNotPermalinkFeed - title = 'Arch Linux: Recent news updates' + title = settings.BRANDING_DISTRONAME+': Recent news updates' link = '/news/' - description = 'The latest and greatest news from the Arch Linux distribution.' + description = 'The latest and greatest news from the '+settings.BRANDING_DISTRONAME+' distribution.' subtitle = description title_template = 'feeds/news_title.html' description_template = 'feeds/news_description.html' diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py index ddf930db..498bb533 100644 --- a/packages/management/commands/signoff_report.py +++ b/packages/management/commands/signoff_report.py @@ -8,6 +8,7 @@ repository. Usage: ./manage.py signoff_report """ +from django.conf import settings from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.core.management.base import BaseCommand, CommandError @@ -120,7 +121,7 @@ def generate_report(email, repo_name): 'old_days': old_days, 'leaders': leaders, }) - from_addr = 'Arch Website Notification ' + from_addr = settings.BRANDING_EMAIL send_mail(subject, t.render(c), from_addr, [email]) # vim: set ts=4 sw=4 et: diff --git a/packages/views/flag.py b/packages/views/flag.py index 0d2f9009..760bdd94 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -98,7 +98,7 @@ def flag(request, name, repo, arch): }) send_mail(subject, tmpl.render(ctx), - 'Arch Website Notification ', + settings.BRANDING_EMAIL, toemail, fail_silently=True) diff --git a/public/views.py b/public/views.py index 3ea8f841..c2c42f5a 100644 --- a/public/views.py +++ b/public/views.py @@ -26,15 +26,15 @@ def index(request): USER_LISTS = { 'devs': { 'user_type': 'Developers', - 'description': "This is a list of the current Arch Linux Developers. They maintain the [core] and [extra] package repositories in addition to doing any other developer duties.", + 'description': "This is a list of the current "+settings.BRANDING_DISTRONAME+" Developers. They maintain the [core] and [extra] package repositories in addition to doing any other developer duties.", }, 'tus': { 'user_type': 'Trusted Users', - 'description': "Here are all your friendly Arch Linux Trusted Users who are in charge of the [community] repository.", + 'description': "Here are all your friendly "+settings.BRANDING_DISTRONAME+" Trusted Users who are in charge of the [community] repository.", }, 'fellows': { 'user_type': 'Fellows', - 'description': "Below you can find a list of ex-developers (aka project fellows). These folks helped make Arch what it is today. Thanks!", + 'description': "Below you can find a list of ex-developers (aka project fellows). These folks helped make "+settings.BRANDING_SHORTNAME+" what it is today. Thanks!", }, } diff --git a/settings.py b/settings.py index 52339c53..998eefbd 100644 --- a/settings.py +++ b/settings.py @@ -156,3 +156,8 @@ if DEBUG_TOOLBAR: INSTALLED_APPS = list(INSTALLED_APPS) + [ 'debug_toolbar' ] # vim: set ts=4 sw=4 et: + +BRANDING_APPNAME = 'archweb' +BRANDING_DISTRONAME = 'Arch Linux' +BRANDING_SHORTNAME = 'Arch' +BRANDING_EMAIL = 'Arch Website Notification ' -- cgit v1.2.3