mirror of
https://github.com/django-components/django-components.git
synced 2025-08-03 22:08:17 +00:00
Install isort and fix all imports.
This commit is contained in:
parent
cbe2bcc9c9
commit
40ebd6b936
8 changed files with 28 additions and 5 deletions
|
@ -1,8 +1,11 @@
|
|||
from django.template.loader import render_to_string
|
||||
from .component_registry import ComponentRegistry, AlreadyRegistered, NotRegistered # NOQA
|
||||
from django.forms.widgets import MediaDefiningClass
|
||||
from django.template.loader import render_to_string
|
||||
from six import with_metaclass
|
||||
|
||||
# Allow "component.AlreadyRegistered" instead of having to import these everywhere
|
||||
from django_components.component_registry import AlreadyRegistered, ComponentRegistry, NotRegistered # NOQA
|
||||
|
||||
|
||||
class Component(with_metaclass(MediaDefiningClass)):
|
||||
def context(self):
|
||||
return {}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from django import template
|
||||
from django_components.component import registry
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from django_components.component import registry
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.simple_tag(name="component_dependencies")
|
||||
|
|
|
@ -3,3 +3,4 @@
|
|||
tox
|
||||
pytest
|
||||
flake8
|
||||
isort
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
[flake8]
|
||||
ignore = E302
|
||||
max-line-length = 119
|
||||
|
||||
[isort]
|
||||
line_length = 119
|
||||
multi_line_output = 5
|
||||
include_trailing_comma = True
|
||||
not_skip = __init__.py
|
||||
known_first_party =
|
||||
django_components
|
||||
|
|
2
setup.py
2
setup.py
|
@ -1,4 +1,4 @@
|
|||
from setuptools import setup, find_packages
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
setup(
|
||||
name='django-components',
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
from textwrap import dedent
|
||||
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
from django_components import component
|
||||
|
||||
from .django_test_setup import * # NOQA
|
||||
|
||||
|
||||
class SimpleComponent(component.Component):
|
||||
def context(self, variable=None):
|
||||
return {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import unittest
|
||||
|
||||
from django_components import component
|
||||
|
||||
|
||||
class MockComponent(object):
|
||||
pass
|
||||
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
from textwrap import dedent
|
||||
|
||||
from django.template import Context, Template
|
||||
from django.test import SimpleTestCase
|
||||
from django.template import Template, Context
|
||||
|
||||
from django_components import component
|
||||
|
||||
from .django_test_setup import * # NOQA
|
||||
|
||||
|
||||
class SimpleComponent(component.Component):
|
||||
def context(self, variable):
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue