Ticket #23395: shorter-lines.diff

File shorter-lines.diff, 6.0 KB (added by Tim Graham, 10 years ago)
  • django/db/backends/postgresql_psycopg2/introspection.py

    diff --git a/django/db/backends/postgresql_psycopg2/introspection.py b/django/db/backends/postgresql_psycopg2/introspection.py
    index aef0bf0..a38a13a 100644
    a b class DatabaseIntrospection(BaseDatabaseIntrospection):  
    128128                kc.constraint_name,
    129129                kc.column_name,
    130130                c.constraint_type,
    131                 array(SELECT table_name::text || '.' || column_name::text FROM information_schema.constraint_column_usage WHERE constraint_name = kc.constraint_name)
     131                array(SELECT table_name::text || '.' || column_name::text
     132                      FROM information_schema.constraint_column_usage
     133                      WHERE constraint_name = kc.constraint_name)
    132134            FROM information_schema.key_column_usage AS kc
    133135            JOIN information_schema.table_constraints AS c ON
    134136                kc.table_schema = c.table_schema AND
  • django/db/backends/schema.py

    diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
    index db22dba..fd94837 100644
    a b class BaseDatabaseSchemaEditor(object):  
    491491        new_db_params = new_field.db_parameters(connection=self.connection)
    492492        new_type = new_db_params['type']
    493493        if (old_type is None and old_field.rel is None) or (new_type is None and new_field.rel is None):
    494             raise ValueError("Cannot alter field %s into %s - they do not properly define db_type (are you using PostGIS 1.5 or badly-written custom fields?)" % (
    495                 old_field,
    496                 new_field,
    497             ))
     494            raise ValueError(
     495                "Cannot alter field %s into %s - they do not properly define "
     496                "db_type (are you using PostGIS 1.5 or badly-written custom "
     497                "fields?)" % (
     498                    old_field,
     499                    new_field,
     500                ),
     501            )
    498502        elif old_type is None and new_type is None and (old_field.rel.through and new_field.rel.through and old_field.rel.through._meta.auto_created and new_field.rel.through._meta.auto_created):
    499503            return self._alter_many_to_many(model, old_field, new_field, strict)
    500504        elif old_type is None and new_type is None and (old_field.rel.through and new_field.rel.through and not old_field.rel.through._meta.auto_created and not new_field.rel.through._meta.auto_created):
    501505            # Both sides have through models; this is a no-op.
    502506            return
    503507        elif old_type is None or new_type is None:
    504             raise ValueError("Cannot alter field %s into %s - they are not compatible types (you cannot alter to or from M2M fields, or add or remove through= on M2M fields)" % (
    505                 old_field,
    506                 new_field,
    507             ))
     508            raise ValueError(
     509                "Cannot alter field %s into %s - they are not compatible types "
     510                "(you cannot alter to or from M2M fields, or add or remove "
     511                "through= on M2M fields)" % (
     512                    old_field,
     513                    new_field,
     514                )
     515            )
    508516
    509517        self._alter_field(model, old_field, new_field, old_type, new_type, old_db_params, new_db_params, strict)
    510518
  • django/utils/lorem_ipsum.py

    diff --git a/django/utils/lorem_ipsum.py b/django/utils/lorem_ipsum.py
    index b91fecf..19bf899 100644
    a b from __future__ import unicode_literals  
    66
    77import random
    88
    9 COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
     9COMMON_P = (
     10    'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod '
     11    'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim '
     12    'veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea '
     13    'commodo consequat. Duis aute irure dolor in reprehenderit in voluptate '
     14    'velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint '
     15    'occaecat cupidatat non proident, sunt in culpa qui officia deserunt '
     16    'mollit anim id est laborum.'
     17)
    1018
    1119WORDS = ('exercitationem', 'perferendis', 'perspiciatis', 'laborum', 'eveniet',
    1220        'sunt', 'iure', 'nam', 'nobis', 'eum', 'cum', 'officiis', 'excepturi',
  • django/utils/translation/trans_real.py

    diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
    index 5715d57..3d94f22 100644
    a b def templatize(src, origin=None):  
    618618                    filemsg = ''
    619619                    if origin:
    620620                        filemsg = 'file %s, ' % origin
    621                     raise SyntaxError("Translation blocks must not include other block tags: %s (%sline %d)" % (t.contents, filemsg, t.lineno))
     621                    raise SyntaxError(
     622                        "Translation blocks must not include other block tags: "
     623                        "%s (%sline %d)" % (t.contents, filemsg, t.lineno)
     624                    )
    622625            elif t.token_type == TOKEN_VAR:
    623626                if inplural:
    624627                    plural.append('%%(%s)s' % t.contents)
  • setup.cfg

    diff --git a/setup.cfg b/setup.cfg
    index f6a4a2b..5ef789c 100644
    a b install-script = scripts/rpm-install.sh  
    44
    55[flake8]
    66exclude=build,.git,./django/utils/dictconfig.py,./django/utils/unittest.py,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py
    7 ignore=E123,E128,E265,E501,W601
     7ignore=E123,E128,E265,W601
     8max-line-length = 120
    89
    910[metadata]
    1011license-file = LICENSE
Back to Top