Skip to content
This repository was archived by the owner on Aug 17, 2023. It is now read-only.

Commit ca1e864

Browse files
committed
Run isort
1 parent cfc620b commit ca1e864

20 files changed

+57
-36
lines changed

hamlpy/compiler.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python
22

3-
import regex
43
import warnings
54

5+
import regex
6+
67
from hamlpy.parser.core import Stream
78
from hamlpy.parser.nodes import Node, read_node
89

hamlpy/hamlpy_watcher.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
"""
77

88
import argparse
9-
import sys
109
import codecs
1110
import os
1211
import os.path
12+
import sys
1313
import time
14-
1514
from time import strftime
1615

1716
from hamlpy import HAML_EXTENSIONS

hamlpy/jinja.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import jinja2.ext
21
import os
32

3+
import jinja2.ext
4+
45
from hamlpy import HAML_EXTENSIONS
56
from hamlpy.compiler import Compiler
67
from hamlpy.parser.core import ParseException

hamlpy/parser/attributes.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
import regex
2-
31
from collections import OrderedDict
42

5-
from .core import ParseException, read_whitespace, read_symbol, read_number, read_quoted_string, read_word
6-
from .core import peek_indentation, read_line, STRING_LITERALS, WHITESPACE_CHARS
3+
import regex
4+
5+
from .core import (
6+
STRING_LITERALS,
7+
WHITESPACE_CHARS,
8+
ParseException,
9+
peek_indentation,
10+
read_line,
11+
read_number,
12+
read_quoted_string,
13+
read_symbol,
14+
read_whitespace,
15+
read_word,
16+
)
717
from .utils import html_escape
818

919
LEADING_SPACES_REGEX = regex.compile(r"^\s+", regex.V1 | regex.MULTILINE)

hamlpy/parser/elements.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections import OrderedDict
2-
from .attributes import read_attribute_dict
3-
from .core import read_word, read_line
42

3+
from .attributes import read_attribute_dict
4+
from .core import read_line, read_word
55

66
# non-word characters that we allow in tag names, ids and classes
77
DOM_OBJECT_EXTRA_CHARS = ("-",)

hamlpy/parser/filters.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
try:
1616
import pygments
1717
from pygments.formatters import HtmlFormatter
18-
from pygments.lexers import guess_lexer, PythonLexer
18+
from pygments.lexers import PythonLexer, guess_lexer
1919
from pygments.util import ClassNotFound
2020

2121
_pygments_available = True
@@ -32,7 +32,6 @@
3232
from .core import ParseException
3333
from .utils import html_escape
3434

35-
3635
# ----------------------------------------------------------------------------------
3736
# Core filters
3837
# ----------------------------------------------------------------------------------

hamlpy/parser/nodes.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import textwrap
22

3-
from .core import ParseException, TreeNode, read_line, read_whitespace, peek_indentation
3+
from .core import ParseException, TreeNode, peek_indentation, read_line, read_whitespace
44
from .elements import read_element
55
from .filters import get_filter
66

7-
87
XHTML_DOCTYPES = {
98
"1.1": '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', # noqa
109
"strict": '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', # noqa

hamlpy/template/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
from .loaders import haml_loaders as _loaders
22

3-
43
locals().update(_loaders)

hamlpy/template/loaders.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from django.conf import settings
44
from django.template import TemplateDoesNotExist
5-
from django.template.loaders import filesystem, app_directories
5+
from django.template.loaders import app_directories, filesystem
66

77
from hamlpy import HAML_EXTENSIONS
88
from hamlpy.compiler import Compiler

hamlpy/template/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from importlib import machinery
2-
3-
from django.template import loaders
42
from os import listdir
53
from os.path import dirname, splitext
64

5+
from django.template import loaders
6+
77
MODULE_EXTENSIONS = tuple(machinery.all_suffixes())
88

99

hamlpy/test/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import django
21
import os
32

3+
import django
44

55
os.environ["DJANGO_SETTINGS_MODULE"] = "hamlpy.test.settings"
66
django.setup()

hamlpy/test/settings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import django
2-
31
from distutils.version import LooseVersion
42

3+
import django
4+
55
DEBUG = True
66

77
DATABASES = {}

hamlpy/test/test_attributes.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import unittest
2-
32
from collections import OrderedDict
43

54
from hamlpy.compiler import Compiler
65
from hamlpy.parser.attributes import read_attribute_dict
7-
from hamlpy.parser.core import Stream, ParseException
6+
from hamlpy.parser.core import ParseException, Stream
87

98

109
class AttributeDictParserTest(unittest.TestCase):

hamlpy/test/test_elements.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import unittest
2-
32
from collections import OrderedDict
43

54
from hamlpy.compiler import Compiler
65
from hamlpy.parser.core import Stream
7-
from hamlpy.parser.elements import Element, read_tag, read_element
6+
from hamlpy.parser.elements import Element, read_element, read_tag
87

98

109
class ElementTest(unittest.TestCase):

hamlpy/test/test_loader.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import importlib
2-
import pytest
2+
from unittest import mock
33

4+
import pytest
45
from django.template import TemplateDoesNotExist
56
from django.template.loader import render_to_string
67
from django.test import SimpleTestCase
78
from django.test.utils import override_settings
8-
from unittest import mock
99

1010
from hamlpy.compiler import Compiler
1111
from hamlpy.template import loaders

hamlpy/test/test_nodes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from hamlpy.compiler import Compiler
44
from hamlpy.parser import nodes
55
from hamlpy.parser.core import Stream
6-
from hamlpy.parser.nodes import read_node, read_filter_node
6+
from hamlpy.parser.nodes import read_filter_node, read_node
77

88

99
class NodeTest(unittest.TestCase):

hamlpy/test/test_parser.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import unittest
22

3-
from hamlpy.parser.core import Stream, ParseException, read_whitespace, peek_indentation
4-
from hamlpy.parser.core import read_quoted_string, read_line, read_number, read_symbol, read_word
3+
from hamlpy.parser.core import (
4+
ParseException,
5+
Stream,
6+
peek_indentation,
7+
read_line,
8+
read_number,
9+
read_quoted_string,
10+
read_symbol,
11+
read_whitespace,
12+
read_word,
13+
)
514
from hamlpy.parser.utils import html_escape
615

716

hamlpy/test/test_templates.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import os
21
import codecs
3-
import regex
2+
import os
43
import time
54
import unittest
6-
7-
from hamlpy.compiler import Compiler
85
from os import listdir, path
96

7+
import regex
8+
9+
from hamlpy.compiler import Compiler
1010

1111
TEMPLATE_DIRECTORY = "/templates/"
1212
TEMPLATE_EXTENSION = ".hamlpy"

hamlpy/test/test_watcher.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import sys
44
import time
55
import unittest
6-
76
from unittest.mock import patch
87

98
from hamlpy.hamlpy_watcher import watch_folder
109

11-
1210
WORKING_DIR = ".watcher_test"
1311
INPUT_DIR = WORKING_DIR + os.sep + "input"
1412
OUTPUT_DIR = WORKING_DIR + os.sep + "output"

setup.cfg

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ max-line-length = 120
77
exclude = ./env/*,./build/*,./dist/*,./docs/*
88
ignore = E501,E203,W503
99

10+
[isort]
11+
multi_line_output = 3
12+
include_trailing_comma = True
13+
force_grid_wrap = 0
14+
line_length = 119
15+
combine_as_imports = True
16+
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
17+
1018
[wheel]
1119
universal = 1
1220

0 commit comments

Comments
 (0)