Skip to content

Commit 6900672

Browse files
authored
Merge pull request #1 from embar-/short_imports
Shorter multiple imports
2 parents 2bf015c + a729522 commit 6900672

13 files changed

Lines changed: 45 additions & 83 deletions

File tree

pydbml/_classes/reference.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
from typing import Union
66

77
from pydbml.constants import MANY_TO_MANY
8-
from pydbml.exceptions import DBMLError
9-
from pydbml.exceptions import TableNotFoundError
8+
from pydbml.exceptions import DBMLError, TableNotFoundError
109
from .base import SQLObject, DBMLObject
1110
from .column import Column
1211
from .table import Table

pydbml/_classes/table.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
from typing import TYPE_CHECKING
55
from typing import Union
66

7-
from pydbml.exceptions import ColumnNotFoundError
8-
from pydbml.exceptions import IndexNotFoundError
9-
from pydbml.exceptions import UnknownDatabaseError
7+
from pydbml.exceptions import ColumnNotFoundError, IndexNotFoundError, UnknownDatabaseError
108
from .base import SQLObject, DBMLObject
119
from .column import Column
1210
from .index import Index

pydbml/classes/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from .._classes.column import Column
2-
from .._classes.enum import Enum
3-
from .._classes.enum import EnumItem
2+
from .._classes.enum import Enum, EnumItem
43
from .._classes.expression import Expression
54
from .._classes.index import Index
65
from .._classes.note import Note

pydbml/database.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
from typing import Union
66

77
from ._classes.sticky_note import StickyNote
8-
from .classes import Enum
9-
from .classes import Project
10-
from .classes import Reference
11-
from .classes import Table
12-
from .classes import TableGroup
8+
from .classes import Enum, Project, Reference, Table, TableGroup
139
from .exceptions import DatabaseValidationError
1410
from .renderer.base import BaseRenderer
1511
from .renderer.dbml.default.renderer import DefaultDBMLRenderer

pydbml/definitions/column.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import pyparsing as pp
22

3-
from .common import _
4-
from .common import _c
5-
from .common import c
6-
from .common import n
7-
from .common import note
8-
from .common import pk
9-
from .common import unique
10-
from .generic import boolean_literal
11-
from .generic import expression
12-
from .generic import expression_literal
13-
from .generic import name
14-
from .generic import number_literal
15-
from .generic import string_literal
3+
from .common import _, _c, c, n, note, pk, unique
4+
from .generic import (
5+
boolean_literal,
6+
expression,
7+
expression_literal,
8+
name,
9+
number_literal,
10+
string_literal
11+
)
1612
from .reference import ref_inline
1713
from pydbml.parser.blueprints import ColumnBlueprint
1814

pydbml/definitions/enum.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import pyparsing as pp
22

3-
from .common import _
4-
from .common import _c
5-
from .common import c
6-
from .common import end
7-
from .common import n
8-
from .common import note
3+
from .common import _, _c, c, end, n, note
94
from .generic import name
105
from pydbml.parser.blueprints import EnumBlueprint
116
from pydbml.parser.blueprints import EnumItemBlueprint

pydbml/definitions/index.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import pyparsing as pp
22

3-
from .common import _
4-
from .common import _c
5-
from .common import c
6-
from .common import note
7-
from .common import pk
8-
from .common import unique
9-
from .generic import expression_literal
10-
from .generic import name
11-
from .generic import string_literal
12-
from pydbml.parser.blueprints import ExpressionBlueprint
13-
from pydbml.parser.blueprints import IndexBlueprint
3+
from .common import _, _c, c, note, pk, unique
4+
from .generic import expression_literal, name, string_literal
5+
from pydbml.parser.blueprints import ExpressionBlueprint, IndexBlueprint
146

157
pp.ParserElement.set_default_whitespace_chars(' \t\r')
168

pydbml/definitions/project.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import pyparsing as pp
22

3-
from .common import _
4-
from .common import _c
5-
from .common import n
6-
from .common import note
7-
from .common import note_object
8-
from .generic import name
9-
from .generic import string_literal
10-
from pydbml.parser.blueprints import NoteBlueprint
11-
from pydbml.parser.blueprints import ProjectBlueprint
3+
from .common import _, _c, c, n, note, note_object
4+
from .generic import name, string_literal
5+
from pydbml.parser.blueprints import NoteBlueprint, ProjectBlueprint
126

137
pp.ParserElement.set_default_whitespace_chars(' \t\r')
148

pydbml/definitions/reference.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import pyparsing as pp
22

3-
from .common import _
4-
from .common import _c
5-
from .common import c
6-
from .common import n
3+
from .common import _, _c, c, n
74
from .generic import name
85
from pydbml.parser.blueprints import ReferenceBlueprint
96

pydbml/definitions/table.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
from pydbml.parser.blueprints import TableBlueprint
44
from .column import table_column, table_column_with_properties
5-
from .common import _, hex_color
6-
from .common import _c
7-
from .common import end
8-
from .common import note
9-
from .common import note_object
5+
from .common import _, _c, end, hex_color, note, note_object
106
from .generic import name, string_literal
117
from .index import indexes
128

0 commit comments

Comments
 (0)