aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorNate Case <ncase@xes-inc.com>2008-08-23 11:03:18 +0800
committerJeremy Kerr <jk@ozlabs.org>2008-08-23 11:03:18 +0800
commit05d26756d7e7f254d5631a0649aeac5fd3a58ca8 (patch)
treed40b4861766912d9a15cd412f5df7b4d3bd1452d /apps
parent04767c65175f2a76127cd78649c5d92a82a39bb6 (diff)
downloadpatchwork-05d26756d7e7f254d5631a0649aeac5fd3a58ca8.tar
patchwork-05d26756d7e7f254d5631a0649aeac5fd3a58ca8.tar.gz
In some places tabs are used instead of spaces for indentation,
even when other lines of a method are indented with spaces. This gets rid of all tabs and uses spaces everywhere. [Reworked to apply on newer code by Jeremy] Signed-off-by: Nate Case <ncase@xes-inc.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/patchwork/admin.py2
-rwxr-xr-xapps/patchwork/bin/parsemail.py4
-rw-r--r--apps/patchwork/filters.py48
-rw-r--r--apps/patchwork/forms.py8
-rw-r--r--apps/patchwork/models.py38
-rw-r--r--apps/patchwork/parser.py6
-rw-r--r--apps/patchwork/templatetags/filter.py4
-rw-r--r--apps/patchwork/templatetags/person.py4
-rw-r--r--apps/patchwork/urls.py4
-rw-r--r--apps/patchwork/utils.py8
-rw-r--r--apps/patchwork/views/__init__.py4
-rw-r--r--apps/patchwork/views/base.py6
-rw-r--r--apps/patchwork/views/patch.py20
-rw-r--r--apps/patchwork/views/user.py4
-rw-r--r--apps/urls.py10
15 files changed, 85 insertions, 85 deletions
diff --git a/apps/patchwork/admin.py b/apps/patchwork/admin.py
index 264d865..8acf5be 100644
--- a/apps/patchwork/admin.py
+++ b/apps/patchwork/admin.py
@@ -2,7 +2,7 @@ from django.contrib import admin
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from patchwork.models import Project, Person, UserProfile, State, Patch, \
- Comment, Bundle
+ Comment, Bundle
admin_site = admin.AdminSite()
diff --git a/apps/patchwork/bin/parsemail.py b/apps/patchwork/bin/parsemail.py
index 13c6d78..917cdd9 100755
--- a/apps/patchwork/bin/parsemail.py
+++ b/apps/patchwork/bin/parsemail.py
@@ -155,8 +155,8 @@ def find_content(project, mail):
if commentbuf:
if patch:
- cpatch = patch
- else:
+ cpatch = patch
+ else:
cpatch = find_patch_for_comment(mail)
if not cpatch:
return (None, None)
diff --git a/apps/patchwork/filters.py b/apps/patchwork/filters.py
index f7fb652..6cd526b 100644
--- a/apps/patchwork/filters.py
+++ b/apps/patchwork/filters.py
@@ -79,7 +79,7 @@ class SubmitterFilter(Filter):
def __init__(self, filters):
super(SubmitterFilter, self).__init__(filters)
self.name = 'Submitter'
- self.person = None
+ self.person = None
self.person_match = None
def _set_key(self, str):
@@ -127,14 +127,14 @@ class SubmitterFilter(Filter):
return ''
def _form(self):
- name = ''
- if self.person:
- name = self.person.name
- return mark_safe(('<input onKeyUp="submitter_field_change(this)" ' +
- 'name="submitter" id="submitter_input" ' +
+ name = ''
+ if self.person:
+ name = self.person.name
+ return mark_safe(('<input onKeyUp="submitter_field_change(this)" ' +
+ 'name="submitter" id="submitter_input" ' +
'value="%s">&nbsp;' % escape(name)) +
- '<select id="submitter_select" ' +
- 'disabled="true"></select>')
+ '<select id="submitter_select" ' +
+ 'disabled="true"></select>')
def key(self):
if self.person:
@@ -146,7 +146,7 @@ class StateFilter(Filter):
def __init__(self, filters):
super(StateFilter, self).__init__(filters)
self.name = 'State'
- self.state = None
+ self.state = None
def _set_key(self, str):
try:
@@ -171,12 +171,12 @@ class StateFilter(Filter):
str = '<select name="%s">' % self.param
str += '<option value="">any</option>'
for state in State.objects.all():
- selected = ''
+ selected = ''
if self.state and self.state == state:
- selected = ' selected="true"'
+ selected = ' selected="true"'
str += '<option value="%d" %s>%s</option>' % \
- (state.id, selected, state.name)
+ (state.id, selected, state.name)
str += '</select>'
return mark_safe(str);
@@ -189,12 +189,12 @@ class SearchFilter(Filter):
super(SearchFilter, self).__init__(filters)
self.name = 'Search'
self.param = 'q'
- self.search = None
+ self.search = None
def _set_key(self, str):
- str = str.strip()
- if str == '':
- return
+ str = str.strip()
+ if str == '':
+ return
self.search = str
self.applied = True
@@ -208,11 +208,11 @@ class SearchFilter(Filter):
return self.search
def _form(self):
- value = ''
- if self.search:
- value = escape(self.search)
+ value = ''
+ if self.search:
+ value = escape(self.search)
return mark_safe('<input name="%s" value="%s">' %\
- (self.param, value))
+ (self.param, value))
def form_function(self):
return mark_safe('function(form) { return form.x.value }')
@@ -253,9 +253,9 @@ class ArchiveFilter(Filter):
return self.description_map[self.archive_state]
def key(self):
- if self.archive_state == False:
- return None
- return self.param_map[self.archive_state]
+ if self.archive_state == False:
+ return None
+ return self.param_map[self.archive_state]
def _form(self):
s = ''
@@ -402,7 +402,7 @@ class Filters:
def params(self):
return [ (f.param, f.key()) for f in self._filters \
- if f.key() is not None ]
+ if f.key() is not None ]
def querystring(self, remove = None):
params = dict(self.params())
diff --git a/apps/patchwork/forms.py b/apps/patchwork/forms.py
index 7385ced..c02d11e 100644
--- a/apps/patchwork/forms.py
+++ b/apps/patchwork/forms.py
@@ -77,7 +77,7 @@ class CreateBundleForm(forms.ModelForm):
class DelegateField(forms.ModelChoiceField):
def __init__(self, project, *args, **kwargs):
- queryset = User.objects.filter(userprofile__in = \
+ queryset = User.objects.filter(userprofile__in = \
UserProfile.objects \
.filter(maintainer_projects = project) \
.values('pk').query)
@@ -86,10 +86,10 @@ class DelegateField(forms.ModelChoiceField):
class PatchForm(forms.ModelForm):
def __init__(self, instance = None, project = None, *args, **kwargs):
- if (not project) and instance:
+ if (not project) and instance:
project = instance.project
if not project:
- raise Exception("meep")
+ raise Exception("meep")
super(PatchForm, self).__init__(instance = instance, *args, **kwargs)
self.fields['delegate'] = DelegateField(project, required = False)
@@ -172,7 +172,7 @@ class MultiplePatchForm(PatchForm):
super(MultiplePatchForm, self).__init__(project = project,
*args, **kwargs)
self.fields['delegate'] = OptionalDelegateField(project = project,
- required = False)
+ required = False)
def save(self, instance, commit = True):
opts = instance.__class__._meta
diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py
index d8a9b3f..6d331f3 100644
--- a/apps/patchwork/models.py
+++ b/apps/patchwork/models.py
@@ -79,8 +79,8 @@ class UserProfile(models.Model):
def name(self):
if self.user.first_name or self.user.last_name:
- names = filter(bool, [self.user.first_name, self.user.last_name])
- return ' '.join(names)
+ names = filter(bool, [self.user.first_name, self.user.last_name])
+ return ' '.join(names)
return self.user.username
def contributor_projects(self):
@@ -114,16 +114,16 @@ class UserProfile(models.Model):
return qs
def save(self):
- super(UserProfile, self).save()
- people = Person.objects.filter(email = self.user.email)
- if not people:
- person = Person(email = self.user.email,
- name = self.name(), user = self.user)
+ super(UserProfile, self).save()
+ people = Person.objects.filter(email = self.user.email)
+ if not people:
+ person = Person(email = self.user.email,
+ name = self.name(), user = self.user)
person.save()
- else:
- for person in people:
- person.user = self.user
- person.save()
+ else:
+ for person in people:
+ person.user = self.user
+ person.save()
def __str__(self):
return self.name()
@@ -143,8 +143,8 @@ class UserPersonConfirmation(models.Model):
active = models.BooleanField(default = True)
def confirm(self):
- if not self.active:
- return
+ if not self.active:
+ return
person = None
try:
person = Person.objects.get(email = self.email)
@@ -194,10 +194,10 @@ class HashField(models.Field):
n_bytes = len(hashlib.new(self.algorithm).digest())
else:
n_bytes = len(self.hash_constructor().digest())
- if settings.DATABASE_ENGINE == 'postgresql':
- return 'bytea'
- elif settings.DATABASE_ENGINE == 'mysql':
- return 'binary(%d)' % n_bytes
+ if settings.DATABASE_ENGINE == 'postgresql':
+ return 'bytea'
+ elif settings.DATABASE_ENGINE == 'mysql':
+ return 'binary(%d)' % n_bytes
def to_python(self, value):
return value
@@ -226,10 +226,10 @@ class Patch(models.Model):
return self.name
def comments(self):
- return Comment.objects.filter(patch = self)
+ return Comment.objects.filter(patch = self)
def save(self):
- try:
+ try:
s = self.state
except:
self.state = State.objects.get(ordering = 0)
diff --git a/apps/patchwork/parser.py b/apps/patchwork/parser.py
index bb6fce0..021dbcd 100644
--- a/apps/patchwork/parser.py
+++ b/apps/patchwork/parser.py
@@ -170,8 +170,8 @@ def patch_hash(str):
if len(line) <= 0:
continue
- hunk_match = _hunk_re.match(line)
- filename_match = _filename_re.match(line)
+ hunk_match = _hunk_re.match(line)
+ filename_match = _filename_re.match(line)
if filename_match:
# normalise -p1 top-directories
@@ -184,7 +184,7 @@ def patch_hash(str):
line = filename_match.group(1) + ' ' + filename
- elif hunk_match:
+ elif hunk_match:
# remove line numbers
def fn(x):
if not x:
diff --git a/apps/patchwork/templatetags/filter.py b/apps/patchwork/templatetags/filter.py
index b940599..7a5d9df 100644
--- a/apps/patchwork/templatetags/filter.py
+++ b/apps/patchwork/templatetags/filter.py
@@ -28,9 +28,9 @@ register = template.Library()
@register.filter
def personify(person):
if person.name:
- linktext = escape(person.name)
+ linktext = escape(person.name)
else:
- linktext = escape(person.email)
+ linktext = escape(person.email)
return '<a href="javascript:personpopup(\'%s\')">%s</a>' % (escape(person.email), linktext)
diff --git a/apps/patchwork/templatetags/person.py b/apps/patchwork/templatetags/person.py
index 6a6a6af..07c356a 100644
--- a/apps/patchwork/templatetags/person.py
+++ b/apps/patchwork/templatetags/person.py
@@ -28,9 +28,9 @@ register = template.Library()
def personify(person):
if person.name:
- linktext = escape(person.name)
+ linktext = escape(person.name)
else:
- linktext = escape(person.email)
+ linktext = escape(person.email)
str = '<a href="mailto:%s">%s</a>' % \
(escape(person.email), linktext)
diff --git a/apps/patchwork/urls.py b/apps/patchwork/urls.py
index 194f512..9e7e6b9 100644
--- a/apps/patchwork/urls.py
+++ b/apps/patchwork/urls.py
@@ -36,9 +36,9 @@ urlpatterns = patterns('',
(r'^user/todo/(?P<project_id>[^/]+)/$', 'patchwork.views.user.todo_list'),
(r'^user/bundle/(?P<bundle_id>[^/]+)/$',
- 'patchwork.views.bundle.bundle'),
+ 'patchwork.views.bundle.bundle'),
(r'^user/bundle/(?P<bundle_id>[^/]+)/mbox/$',
- 'patchwork.views.bundle.mbox'),
+ 'patchwork.views.bundle.mbox'),
(r'^user/link/$', 'patchwork.views.user.link'),
(r'^user/link/(?P<key>[^/]+)/$', 'patchwork.views.user.link_confirm'),
diff --git a/apps/patchwork/utils.py b/apps/patchwork/utils.py
index dfe1c92..76679c3 100644
--- a/apps/patchwork/utils.py
+++ b/apps/patchwork/utils.py
@@ -40,10 +40,10 @@ def get_patch_ids(d, prefix = 'patch_id'):
class Order(object):
order_map = {
- 'date': 'date',
- 'name': 'name',
- 'state': 'state__ordering',
- 'submitter': 'submitter__name'
+ 'date': 'date',
+ 'name': 'name',
+ 'state': 'state__ordering',
+ 'submitter': 'submitter__name'
}
default_order = 'date'
diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py
index b5c19c2..16a84cc 100644
--- a/apps/patchwork/views/__init__.py
+++ b/apps/patchwork/views/__init__.py
@@ -55,12 +55,12 @@ def generic_list(request, project, view,
ps.append(patch)
(errors, form) = set_patches(request.user, project, action, \
- request.POST, ps, context)
+ request.POST, ps, context)
if errors:
context['errors'] = errors
if not (request.user.is_authenticated() and \
- project in request.user.get_profile().maintainer_projects.all()):
+ project in request.user.get_profile().maintainer_projects.all()):
form = None
for (filterclass, setting) in filter_settings:
diff --git a/apps/patchwork/views/base.py b/apps/patchwork/views/base.py
index b3b1c12..a09ced0 100644
--- a/apps/patchwork/views/base.py
+++ b/apps/patchwork/views/base.py
@@ -60,9 +60,9 @@ def submitter_complete(request):
search = request.GET.get('q', '')
response = HttpResponse(mimetype = "text/plain")
if len(search) > 3:
- queryset = Person.objects.filter(name__icontains = search)
- json_serializer = serializers.get_serializer("json")()
- json_serializer.serialize(queryset, ensure_ascii=False, stream=response)
+ queryset = Person.objects.filter(name__icontains = search)
+ json_serializer = serializers.get_serializer("json")()
+ json_serializer.serialize(queryset, ensure_ascii=False, stream=response)
return response
help_pages = {'': 'index.html', 'about/': 'about.html'}
diff --git a/apps/patchwork/views/patch.py b/apps/patchwork/views/patch.py
index c0960c1..72472ca 100644
--- a/apps/patchwork/views/patch.py
+++ b/apps/patchwork/views/patch.py
@@ -25,7 +25,7 @@ from patchwork.utils import get_patch_ids, set_patches, Order
from patchwork.requestcontext import PatchworkRequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, \
- HttpResponseForbidden
+ HttpResponseForbidden
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login
@@ -71,7 +71,7 @@ def patch(request, patch_id):
bundle.save()
context.add_message('Patch added to bundle "%s"' % bundle.name)
- # all other actions require edit privs
+ # all other actions require edit privs
elif not editable:
return HttpResponseForbidden()
@@ -81,14 +81,14 @@ def patch(request, patch_id):
form.save()
context.add_message('Patch updated')
- elif action == 'archive':
- patch.archived = True
- patch.save()
+ elif action == 'archive':
+ patch.archived = True
+ patch.save()
context.add_message('Patch archived')
- elif action == 'unarchive':
- patch.archived = False
- patch.save()
+ elif action == 'unarchive':
+ patch.archived = False
+ patch.save()
context.add_message('Patch un-archived')
elif action == 'ack':
@@ -157,13 +157,13 @@ def list(request, project_id):
ps.append(patch)
(errors, form) = set_patches(request.user, project, action, \
- request.POST, ps)
+ request.POST, ps)
if errors:
context['errors'] = errors
elif request.user.is_authenticated() and \
- project in request.user.get_profile().maintainer_projects.all():
+ project in request.user.get_profile().maintainer_projects.all():
form = MultiplePatchForm(project)
patches = Patch.objects.filter(project=project).order_by(order)
diff --git a/apps/patchwork/views/user.py b/apps/patchwork/views/user.py
index 19091d3..b042d35 100644
--- a/apps/patchwork/views/user.py
+++ b/apps/patchwork/views/user.py
@@ -24,9 +24,9 @@ from django.shortcuts import render_to_response, get_object_or_404
from django.contrib import auth
from django.http import HttpResponse, HttpResponseRedirect
from patchwork.models import Project, Patch, Bundle, Person, UserProfile, \
- UserPersonConfirmation, State
+ UserPersonConfirmation, State
from patchwork.forms import MultiplePatchForm, UserProfileForm, \
- UserPersonLinkForm
+ UserPersonLinkForm
from patchwork.utils import Order, get_patch_ids
from patchwork.filters import DelegateFilter
from patchwork.paginator import Paginator
diff --git a/apps/urls.py b/apps/urls.py
index 1a6f94b..6e7f34e 100644
--- a/apps/urls.py
+++ b/apps/urls.py
@@ -31,8 +31,8 @@ urlpatterns = patterns('',
# override the default registration form
url(r'^accounts/register/$',
register,
- {'form_class': RegistrationForm,
- 'profile_callback': userprofile_register_callback},
+ {'form_class': RegistrationForm,
+ 'profile_callback': userprofile_register_callback},
name='registration_register'),
(r'^accounts/', include('registration.urls')),
@@ -41,9 +41,9 @@ urlpatterns = patterns('',
(r'^admin/(.*)', admin_site.root),
(r'^css/(?P<path>.*)$', 'django.views.static.serve',
- {'document_root': '/srv/patchwork/htdocs/css'}),
+ {'document_root': '/srv/patchwork/htdocs/css'}),
(r'^js/(?P<path>.*)$', 'django.views.static.serve',
- {'document_root': '/srv/patchwork/htdocs/js'}),
+ {'document_root': '/srv/patchwork/htdocs/js'}),
(r'^images/(?P<path>.*)$', 'django.views.static.serve',
- {'document_root': '/srv/patchwork/htdocs/images'}),
+ {'document_root': '/srv/patchwork/htdocs/images'}),
)