Skip to content

Commit fb3f898

Browse files
committed
Merge pull request #170 from rambo/autopep8
Automatic code formatting tools
2 parents 2341692 + 8c13da5 commit fb3f898

File tree

106 files changed

+533
-332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+533
-332
lines changed

project/access/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# -*- coding: utf-8 -*-

project/access/admin.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# -*- coding: utf-8 -*-
12
from django.contrib import admin
23
from django.utils.html import format_html
34
from django.utils.translation import ugettext_lazy as _
45
from reversion.admin import VersionAdmin
5-
from .models import TokenType, Token, AccessType, Grant, NonMemberToken
6+
7+
from .models import AccessType, Grant, NonMemberToken, Token, TokenType
68

79

810
class TokenTypeAdmin(VersionAdmin):
@@ -14,7 +16,7 @@ class TokenTypeListFilter(admin.SimpleListFilter):
1416
parameter_name = 'ttype'
1517

1618
def lookups(self, request, model_admin):
17-
return ( (x.pk, x.label) for x in TokenType.objects.all() )
19+
return ((x.pk, x.label) for x in TokenType.objects.all())
1820

1921
def queryset(self, request, queryset):
2022
v = self.value()
@@ -28,7 +30,7 @@ class RevokedListFilter(admin.SimpleListFilter):
2830
parameter_name = 'revoked'
2931

3032
def lookups(self, request, model_admin):
31-
return ( ( "-2", _("All")), (None, _("Not revoked")), ("1", _("Revoked")) )
33+
return (("-2", _("All")), (None, _("Not revoked")), ("1", _("Revoked")))
3234

3335
def choices(self, cl):
3436
for lookup, title in self.lookup_choices:
@@ -85,7 +87,7 @@ class AccessTypeListFilter(admin.SimpleListFilter):
8587
parameter_name = 'atype'
8688

8789
def lookups(self, request, model_admin):
88-
return ( (x.pk, x.label) for x in AccessType.objects.all() )
90+
return ((x.pk, x.label) for x in AccessType.objects.all())
8991

9092
def queryset(self, request, queryset):
9193
v = self.value()
@@ -109,6 +111,7 @@ def owner_f(self, obj):
109111

110112

111113
class GrantsListFilter(AccessTypeListFilter):
114+
112115
def queryset(self, request, queryset):
113116
v = self.value()
114117
if not v:
@@ -127,7 +130,7 @@ class NonMemberTokenAdmin(VersionAdmin):
127130
list_filter = (GrantsListFilter, TokenTypeListFilter, RevokedListFilter)
128131

129132
def grants_formatted(self, obj):
130-
return ', '.join(( x.label for x in obj.grants.all() ))
133+
return ', '.join((x.label for x in obj.grants.all()))
131134
grants_formatted.short_description = _("Grants")
132135

133136
def value_formatted(self, obj):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# -*- coding: utf-8 -*-
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# -*- coding: utf-8 -*-

project/access/management/commands/exporttokens.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# -*- coding: utf-8 -*-
12
import sqlite3
2-
from django.core.management.base import BaseCommand, CommandError
3+
34
from access.utils import all_tokens
5+
from django.core.management.base import BaseCommand, CommandError
46

57

68
class Command(BaseCommand):

project/access/management/commands/generate_accesstypesetc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
2+
from access.tests.fixtures import accesstypes, tokentypes
23
from django.core.management.base import BaseCommand, CommandError
3-
from access.tests.fixtures import tokentypes, accesstypes
44

55

66
class Command(BaseCommand):

project/access/management/commands/generate_grants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
from django.core.management.base import BaseCommand, CommandError
32
from access.tests.fixtures.grants import GrantFactory
3+
from django.core.management.base import BaseCommand, CommandError
44

55

66
class Command(BaseCommand):

project/access/management/commands/generate_nonmembertokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
from django.core.management.base import BaseCommand, CommandError
32
from access.tests.fixtures.nonmembertokens import NonMemberTokenFactory
3+
from django.core.management.base import BaseCommand, CommandError
44

55

66
class Command(BaseCommand):

project/access/management/commands/generate_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
from django.core.management.base import BaseCommand, CommandError
32
from access.tests.fixtures.tokens import TokenFactory
3+
from django.core.management.base import BaseCommand, CommandError
44

55

66
class Command(BaseCommand):

project/access/migrations/0002_auto_20151206_1842.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
from django.db import migrations, models
54
import django_markdown.models
5+
from django.db import migrations, models
6+
67
import asylum.mixins
78

89

0 commit comments

Comments
 (0)