Commit b348108b authored by Stephen Finucane's avatar Stephen Finucane Committed by Damien Lespiau
Browse files

trivial: Reorder imports



Imports are easier to read if they are grouped by type (standard
library, third party, application) and organised alphabetically. Make
it so.

v2: Port to fdo's patchwork (Damien)
Signed-off-by: default avatarStephen Finucane <stephen.finucane@intel.com>
parent ff7f716d
......@@ -21,9 +21,8 @@ from __future__ import absolute_import
from django.contrib import admin
from patchwork.models import (
Project, Person, UserProfile, State, Patch, Comment, Bundle, Tag, Test,
TestResult)
from patchwork.models import (Project, Person, UserProfile, State, Patch,
Comment, Bundle, Tag, Test, TestResult)
class ProjectAdmin(admin.ModelAdmin):
......
......@@ -21,9 +21,9 @@
from __future__ import print_function
import sys
import subprocess
from optparse import OptionParser
import subprocess
import sys
def commits(options, revlist):
cmd = ['git', 'rev-list', revlist]
......
......@@ -17,15 +17,17 @@
# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from __future__ import absolute_import
from patchwork.models import Person, State
from django.utils.safestring import mark_safe
from django.utils.html import escape
from django.contrib.auth.models import User
from urllib import quote
from django.contrib.auth.models import User
from django.utils.html import escape
from django.utils.safestring import mark_safe
from patchwork.models import Person, State
class Filter(object):
def __init__(self, filters):
self.filters = filters
......
......@@ -24,6 +24,7 @@ from django import forms
from patchwork.models import Patch, State, Bundle, UserProfile
class RegistrationForm(forms.Form):
first_name = forms.CharField(max_length = 30, required = False)
last_name = forms.CharField(max_length = 30, required = False)
......
......@@ -18,6 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.core.management.base import BaseCommand
from patchwork.utils import send_notifications, do_expiry
......
......@@ -19,6 +19,7 @@
import sys
from django.core.management.base import BaseCommand
from patchwork.models import Patch
......
......@@ -19,8 +19,9 @@
from __future__ import absolute_import
from django.core import paginator
from django.conf import settings
from django.core import paginator
DEFAULT_PATCHES_PER_PAGE = 100
LONG_PAGE_THRESHOLD = 30
......
......@@ -22,9 +22,10 @@
from __future__ import absolute_import
from __future__ import print_function
from collections import Counter
import hashlib
import re
from collections import Counter
_hunk_re = re.compile('^\@\@ -\d+(?:,(\d+))? \+\d+(?:,(\d+))? \@\@')
_filename_re = re.compile('^(---|\+\+\+) (\S+)')
......
......@@ -19,10 +19,11 @@
from __future__ import absolute_import
from django.conf import settings
from django.contrib.sites.models import Site
from django.template import RequestContext
from django.utils.html import escape
from django.contrib.sites.models import Site
from django.conf import settings
from patchwork.filters import Filters
from patchwork.models import Bundle, Project
......
......@@ -19,12 +19,14 @@
from __future__ import absolute_import
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
from django import template
from django.utils.html import escape
from django.utils.encoding import smart_str
from django.utils.html import escape
from patchwork.filters import filterclasses
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
register = template.Library()
......
......@@ -23,8 +23,8 @@ from django import template
from django.utils.safestring import mark_safe
from django.template.defaultfilters import stringfilter
register = template.Library()
register = template.Library()
@register.filter(name='patch_tags')
def patch_tags(patch, tag):
......
......@@ -19,12 +19,15 @@
from __future__ import absolute_import
import re
from django.core.urlresolvers import reverse
from django import template
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from patchwork.filters import SubmitterFilter
import re
register = template.Library()
......
......@@ -19,10 +19,12 @@
from __future__ import absolute_import
import re
from django import template
from django.utils.html import escape
from django.utils.safestring import mark_safe
import re
register = template.Library()
......
......@@ -19,12 +19,14 @@
from __future__ import absolute_import
import unittest
import datetime
import unittest
from django.conf import settings
from django.test import TestCase
from django.test.client import Client
from django.utils.http import urlencode
from django.conf import settings
from patchwork.models import Patch, Bundle, BundlePatch, Person
from patchwork.tests.utils import defaults, create_user, find_in_context
......
......@@ -17,11 +17,13 @@
# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from patchwork.models import EmailConfirmation, Person
def _confirmation_url(conf):
return reverse('patchwork.views.confirm', kwargs = {'key': conf.key})
......
......@@ -17,13 +17,16 @@
# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import unittest
import os
import time
import unittest
from django.test.client import Client
from django.test import TestCase
from patchwork.models import Patch, Person
from patchwork.tests.utils import defaults, read_patch
from django.test import TestCase
from django.test.client import Client
class UTF8PatchViewTest(TestCase):
fixtures = ['default_states', 'default_events']
......
......@@ -17,14 +17,17 @@
# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import unittest
import datetime
from django.test import TestCase
import unittest
from django.contrib.auth.models import User
from django.test import TestCase
from patchwork.models import EmailConfirmation, Person, Patch
from patchwork.tests.utils import create_user, defaults
from patchwork.utils import do_expiry
class TestRegistrationExpiry(TestCase):
fixtures = ['default_states', 'default_events']
......
......@@ -18,10 +18,13 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import unittest
from django.test import TestCase
from django.test.client import Client
from patchwork.tests.utils import defaults, create_user, find_in_context
class FilterQueryStringTest(TestCase):
def testFilterQSEscaping(self):
"""test that filter fragments in a query string are properly escaped,
......
......@@ -19,16 +19,19 @@
from __future__ import absolute_import
import unittest
import random
import datetime
import string
import random
import re
from django.test import TestCase
import string
import unittest
from django.core.urlresolvers import reverse
from django.test.client import Client
from patchwork.tests.utils import defaults, create_user, find_in_context
from django.test import TestCase
from patchwork.models import Person, Patch
from django.core.urlresolvers import reverse
from patchwork.tests.utils import defaults, create_user, find_in_context
class EmptyPatchListTest(TestCase):
......
......@@ -18,12 +18,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import re
from django.test import TestCase
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from patchwork.models import EmailOptout, EmailConfirmation, Person
from patchwork.tests.utils import create_user, error_strings
class MailSettingsTest(TestCase):
def setUp(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment