Harmonized some PEP 0263 coding preambles
This commit is contained in:
parent
27aa85246a
commit
e520a73eee
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from copy import copy
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# -*- coding: utf8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .messages import (CheckMessage,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from optparse import make_option
|
||||
from collections import OrderedDict
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from optparse import make_option
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@ class MigrationWriter(object):
|
|||
|
||||
|
||||
MIGRATION_TEMPLATE = """\
|
||||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
|
|
@ -192,7 +192,7 @@ class in the migration file, and just pass it to ``RunPython``. Here's an
|
|||
example of using ``RunPython`` to create some initial objects on a ``Country``
|
||||
model::
|
||||
|
||||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.db import models, migrations
|
||||
|
||||
def forwards_func(apps, schema_editor):
|
||||
|
|
|
@ -338,7 +338,7 @@ the file in the right place, suggest a name, and add dependencies for you)::
|
|||
|
||||
Then, open up the file; it should look something like this::
|
||||
|
||||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.db import models, migrations
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
@ -365,7 +365,7 @@ combined values of ``first_name`` and ``last_name`` (we've come to our senses
|
|||
and realized that not everyone has first and last names). All we
|
||||
need to do is use the historical model and iterate over the rows::
|
||||
|
||||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.db import models, migrations
|
||||
|
||||
def combine_names(apps, schema_editor):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.contrib import admin
|
||||
from django.db import models
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.contrib.contenttypes.fields import (
|
||||
GenericForeignKey, GenericRelation
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
1. Bare-bones model
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import asyncore
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.test import TestCase, override_settings
|
||||
from django.db.migrations.autodetector import MigrationAutodetector
|
||||
from django.db.migrations.questioner import MigrationQuestioner
|
||||
|
|
|
@ -184,7 +184,7 @@ class MakeMigrationsTests(MigrationTestBase):
|
|||
|
||||
with codecs.open(initial_file, 'r', encoding='utf-8') as fp:
|
||||
content = fp.read()
|
||||
self.assertTrue('# encoding: utf8' in content)
|
||||
self.assertTrue('# -*- coding: utf-8 -*-' in content)
|
||||
self.assertTrue('migrations.CreateModel' in content)
|
||||
|
||||
if six.PY3:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from django.test import TestCase
|
||||
from django.db.migrations.optimizer import MigrationOptimizer
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Tests for template filters (as opposed to template tags).
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import url
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
39. Testing using the Test Client
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.test import TestCase
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Tests for jslex."""
|
||||
# encoding: utf-8
|
||||
# originally from https://bitbucket.org/ned/jslex
|
||||
|
||||
from django.test import TestCase
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# encoding: utf8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.test import TestCase, override_settings
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
from os import path
|
||||
|
||||
from django.conf.urls import url, include
|
||||
|
|
Loading…
Reference in New Issue