Commits

Takeshi Komiya committed 6252ef4

Fix pylint violation: Relative importing

Comments (0)

Files changed (21)

src/blockdiag/builder.py

 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-from elements import *
-import parser
-from utils import XY
+from blockdiag import parser
+from blockdiag.elements import Diagram, DiagramNode, NodeGroup, DiagramEdge
+from blockdiag.elements import unquote
+from blockdiag.utils import XY
 
 
 class DiagramTreeBuilder:

src/blockdiag/drawer.py

 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-import noderenderer
-import imagedraw
-from metrics import AutoScaler
-from metrics import DiagramMetrics
-from utils.collections import defaultdict
+from blockdiag import imagedraw, noderenderer
+from blockdiag.metrics import AutoScaler, DiagramMetrics
+from blockdiag.utils.collections import defaultdict
 
 
 class DiagramDraw(object):

src/blockdiag/elements.py

 import re
 import sys
 import copy
-from utils import images, urlutil, uuid, XY
-import plugins
-import noderenderer
+from blockdiag.utils import images, urlutil, uuid, XY
+from blockdiag import noderenderer, plugins
 
 
 def unquote(string):

src/blockdiag/imagedraw/__init__.py

         raise RuntimeError(msg)
 
     if 'linejump' in kwargs.get('filters', []):
-        from filters.linejump import LineJumpDrawFilter
+        from blockdiag.imagedraw.filters.linejump import LineJumpDrawFilter
         jumpsize = kwargs.get('jumpsize', 0)
         drawer = LineJumpDrawFilter(drawer, jumpsize)
 

src/blockdiag/imagedraw/svg.py

 import re
 import base64
 from blockdiag.imagedraw import base as _base, textfolder
+from blockdiag.imagedraw.simplesvg import *
 from blockdiag.imagedraw.utils import cached
 from blockdiag.utils import urlutil, Box, XY
-from simplesvg import *
 
 feGaussianBlur = svgclass('feGaussianBlur')
 
             return textsize(string, font)
         else:
             if not hasattr(self, '_pil_drawer'):
-                import png
+                from blockdiag.imagedraw import png
                 self._pil_drawer = png.ImageDrawEx(None)
 
             return self._pil_drawer.textlinesize(string, font)

src/blockdiag/metrics.py

 #  limitations under the License.
 
 import copy
-from elements import DiagramNode
-import noderenderer
-from utils import Box, Size, XY
-from utils.fontmap import FontInfo, FontMap
-from utils.collections import defaultdict
+from blockdiag import noderenderer
+from blockdiag.elements import DiagramNode
+from blockdiag.utils import Box, Size, XY
+from blockdiag.utils.fontmap import FontInfo, FontMap
+from blockdiag.utils.collections import defaultdict
 
 cellsize = 8
 

src/blockdiag/parser.py

 from funcparserlib.parser import (some, a, maybe, many, finished, skip,
                                   forward_decl)
 
-from utils.collections import namedtuple
+from blockdiag.utils.collections import namedtuple
 
 ENCODING = 'utf-8'
 

src/blockdiag/tests/test_boot_params.py

 import sys
 import tempfile
 import unittest2
-from utils import argv_wrapper, assertRaises, with_pdf
+from blockdiag.tests.utils import argv_wrapper, assertRaises, with_pdf
+
 import blockdiag
 from blockdiag.command import BlockdiagOptions
 from blockdiag.utils.bootstrap import detectfont

src/blockdiag/tests/test_builder.py

 # -*- coding: utf-8 -*-
 
 from nose.tools import eq_
-from utils import __build_diagram, __validate_node_attributes
+from blockdiag.tests.utils import __build_diagram, __validate_node_attributes
 
 
 def test_diagram_attributes():

src/blockdiag/tests/test_builder_edge.py

 # -*- coding: utf-8 -*-
 
-from utils import stderr_wrapper, __build_diagram, __validate_node_attributes
+from blockdiag.tests.utils import (stderr_wrapper, __build_diagram,
+                                   __validate_node_attributes)
 
 
 def test_single_edge_diagram():

src/blockdiag/tests/test_builder_errors.py

 # -*- coding: utf-8 -*-
 
+from nose.tools import raises
+from blockdiag.tests.utils import __build_diagram
+
 from blockdiag.parser import *
-from nose.tools import raises
-from utils import __build_diagram
 
 
 @raises(AttributeError)

src/blockdiag/tests/test_builder_group.py

 # -*- coding: utf-8 -*-
 
-from utils import __build_diagram, __validate_node_attributes
+from blockdiag.tests.utils import __build_diagram, __validate_node_attributes
 
 
 def test_nested_groups_diagram():

src/blockdiag/tests/test_builder_node.py

 # -*- coding: utf-8 -*-
 
+from blockdiag.tests.utils import __build_diagram, __validate_node_attributes
+
 from blockdiag.utils.collections import defaultdict
-from utils import __build_diagram, __validate_node_attributes
 
 
 def test_single_node_diagram():

src/blockdiag/tests/test_generate_diagram.py

 import sys
 import re
 import tempfile
+from blockdiag.tests.utils import *
+
 import blockdiag
 import blockdiag.command
-from utils import *
 from blockdiag.elements import *
 
 

src/blockdiag/tests/test_rst_directives.py

 import os
 import tempfile
 import unittest2
-from utils import stderr_wrapper, assertRaises
+from blockdiag.tests.utils import stderr_wrapper, assertRaises
+
 from docutils import nodes
 from docutils.core import publish_doctree, publish_parts
 from docutils.parsers.rst import directives as docutils

src/blockdiag/tests/test_utils_fontmap.py

 import sys
 import tempfile
 import unittest2
-from utils import stderr_wrapper, assertRaises
+from blockdiag.tests.utils import stderr_wrapper, assertRaises
+
 from cStringIO import StringIO
 from blockdiag.utils.collections import namedtuple
 from blockdiag.utils.fontmap import FontInfo, FontMap

src/blockdiag/tests/utils.py

 # -*- coding: utf-8 -*-
 import re
+import sys
 from StringIO import StringIO
 from nose.tools import eq_
 from blockdiag.builder import *

src/blockdiag/utils/__init__.py

 #  limitations under the License.
 
 import math
-from namedtuple import namedtuple
+from blockdiag.utils.collections import namedtuple
 
 
 Size = namedtuple('Size', 'width height')

src/blockdiag/utils/fontmap.py

 import os
 import sys
 import copy
-from config import ConfigParser
+from blockdiag.utils.config import ConfigParser
 from blockdiag.utils.collections import namedtuple
 
 

src/blockdiag/utils/images.py

 #  limitations under the License.
 
 import re
-import urlutil
+from blockdiag.utils import urlutil
+
 try:
     from PIL import Image
 except ImportError:
 
             @property
             def size(self):
-                import jpeg
+                from blockdiag.utils import jpeg
                 import png
 
                 try:

src/blockdiag/utils/namedtuple.py

 #  limitations under the License.
 
 
-from collections import namedtuple
+from blockdiag.utils.collections import namedtuple
 namedtuple