Skip to content

Commit 72fd6d0

Browse files
committed
Using relative imports
1 parent 41a2064 commit 72fd6d0

29 files changed

Lines changed: 334 additions & 334 deletions

qwt/__init__.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,33 @@
3333

3434
import warnings
3535

36-
from qwt.plot import QwtPlot
37-
from qwt.symbol import QwtSymbol as QSbl # see deprecated section
38-
from qwt.scale_engine import QwtLinearScaleEngine, QwtLogScaleEngine
39-
from qwt.text import QwtText
40-
from qwt.plot_canvas import QwtPlotCanvas
41-
from qwt.plot_curve import QwtPlotCurve as QPC # see deprecated section
42-
from qwt.plot_curve import QwtPlotItem
43-
from qwt.scale_map import QwtScaleMap
44-
from qwt.interval import QwtInterval
45-
from qwt.legend import QwtLegend, QwtLegendData, QwtLegendLabel
46-
from qwt.plot_marker import QwtPlotMarker
47-
from qwt.plot_grid import QwtPlotGrid as QPG # see deprecated section
48-
from qwt.color_map import QwtLinearColorMap
36+
from .plot import QwtPlot
37+
from .symbol import QwtSymbol as QSbl # see deprecated section
38+
from .scale_engine import QwtLinearScaleEngine, QwtLogScaleEngine
39+
from .text import QwtText
40+
from .plot_canvas import QwtPlotCanvas
41+
from .plot_curve import QwtPlotCurve as QPC # see deprecated section
42+
from .plot_curve import QwtPlotItem
43+
from .scale_map import QwtScaleMap
44+
from .interval import QwtInterval
45+
from .legend import QwtLegend, QwtLegendData, QwtLegendLabel
46+
from .plot_marker import QwtPlotMarker
47+
from .plot_grid import QwtPlotGrid as QPG # see deprecated section
48+
from .color_map import QwtLinearColorMap
4949

50-
from qwt.toqimage import array_to_qimage as toQImage
50+
from .toqimage import array_to_qimage as toQImage
5151

52-
from qwt.scale_div import QwtScaleDiv
53-
from qwt.scale_draw import QwtScaleDraw
54-
from qwt.scale_draw import QwtAbstractScaleDraw
55-
from qwt.painter import QwtPainter
52+
from .scale_div import QwtScaleDiv
53+
from .scale_draw import QwtScaleDraw
54+
from .scale_draw import QwtAbstractScaleDraw
55+
from .painter import QwtPainter
5656

57-
from qwt.plot_series import (QwtSeriesData, QwtPointArrayData, QwtSeriesStore,
57+
from .plot_series import (QwtSeriesData, QwtPointArrayData, QwtSeriesStore,
5858
QwtPlotSeriesItem)
5959

60-
from qwt.plot_renderer import QwtPlotRenderer
60+
from .plot_renderer import QwtPlotRenderer
6161

62-
from qwt.plot_directpainter import QwtPlotDirectPainter
62+
from .plot_directpainter import QwtPlotDirectPainter
6363

6464

6565
## ============================================================================
@@ -101,7 +101,7 @@ def draw(self, painter, *args):
101101
warnings.warn("`draw` has been removed in Qwt6: "\
102102
"please rely on `drawSymbol` and `drawSymbols` instead",
103103
RuntimeWarning)
104-
from qwt.qt.QtCore import QPointF
104+
from .qt.QtCore import QPointF
105105
if len(args) == 2:
106106
self.drawSymbols(painter, [QPointF(*args)])
107107
else:

qwt/color_map.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
:members:
2929
"""
3030

31-
from qwt.qt.QtGui import QColor, qRed, qGreen, qBlue, qRgb, qRgba, qAlpha
32-
from qwt.qt.QtCore import Qt, qIsNaN
31+
from .qt.QtGui import QColor, qRed, qGreen, qBlue, qRgb, qRgba, qAlpha
32+
from .qt.QtCore import Qt, qIsNaN
3333

3434

3535
class ColorStop(object):
@@ -153,7 +153,7 @@ class QwtColorMap(object):
153153
154154
.. seealso ::
155155
156-
:py:data:`qwt.QwtScaleWidget`
156+
:py:data:`.QwtScaleWidget`
157157
"""
158158

159159
# enum Format
@@ -168,7 +168,7 @@ def color(self, interval, value):
168168
"""
169169
Map a value into a color
170170
171-
:param qwt.interval.QwtInterval interval: valid interval for value
171+
:param .interval.QwtInterval interval: valid interval for value
172172
:param float value: value
173173
:return: the color corresponding to value
174174
@@ -191,7 +191,7 @@ def colorTable(self, interval):
191191
"""
192192
Build and return a color map of 256 colors
193193
194-
:param qwt.interval.QwtInterval interval: range for the values
194+
:param .interval.QwtInterval interval: range for the values
195195
:return: a color table, that can be used for a `QImage`
196196
197197
The color table is needed for rendering indexed images in combination

qwt/column_symbol.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
# Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization
66
# (see LICENSE file for more details)
77

8-
from qwt.interval import QwtInterval
8+
from .interval import QwtInterval
99

10-
from qwt.qt.QtGui import QPolygonF, QPalette
11-
from qwt.qt.QtCore import QRectF, Qt
10+
from .qt.QtGui import QPolygonF, QPalette
11+
from .qt.QtCore import QRectF, Qt
1212

1313

1414
def qwtDrawBox(p, rect, pal, lw):

qwt/dyngrid_layout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# (see LICENSE file for more details)
77

88
"""
9-
qwt.dyngrid_layout
9+
.dyngrid_layout
1010
------------------
1111
1212
The `dyngrid_layout` module provides the `QwtDynGridLayout` class.
@@ -15,8 +15,8 @@
1515
:members:
1616
"""
1717

18-
from qwt.qt.QtGui import QLayout
19-
from qwt.qt.QtCore import Qt, QRect, QSize
18+
from .qt.QtGui import QLayout
19+
from .qt.QtCore import Qt, QRect, QSize
2020

2121

2222
class QwtDynGridLayout_PrivateData(object):

qwt/graphic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
:members:
1414
"""
1515

16-
from qwt.null_paintdevice import QwtNullPaintDevice
17-
from qwt.painter_command import QwtPainterCommand
16+
from .null_paintdevice import QwtNullPaintDevice
17+
from .painter_command import QwtPainterCommand
1818

19-
from qwt.qt.QtGui import (QPainter, QPainterPathStroker, QPaintEngine, QPixmap,
19+
from .qt.QtGui import (QPainter, QPainterPathStroker, QPaintEngine, QPixmap,
2020
QTransform, QImage)
21-
from qwt.qt.QtCore import Qt, QRectF, QSizeF, QSize, QPointF, QRect
21+
from .qt.QtCore import Qt, QRectF, QSizeF, QSize, QPointF, QRect
2222

2323
import numpy as np
2424

@@ -250,7 +250,7 @@ class QwtGraphic(QwtNullPaintDevice):
250250
251251
Copy constructor
252252
253-
:param qwt.graphic.QwtGraphic other: Source
253+
:param .graphic.QwtGraphic other: Source
254254
"""
255255

256256
# enum RenderHint

qwt/interval.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def unite(self, other):
235235
"""
236236
Unite two intervals
237237
238-
:param qwt.interval.QwtInterval other: other interval to united with
238+
:param .interval.QwtInterval other: other interval to united with
239239
:return: united interval
240240
"""
241241
if not self.isValid():
@@ -280,7 +280,7 @@ def intersect(self, other):
280280
"""
281281
Intersect two intervals
282282
283-
:param qwt.interval.QwtInterval other: other interval to intersect with
283+
:param .interval.QwtInterval other: other interval to intersect with
284284
:return: intersected interval
285285
"""
286286
if not other.isValid() or not self.isValid():
@@ -326,7 +326,7 @@ def intersects(self, other):
326326
"""
327327
Test if two intervals overlap
328328
329-
:param qwt.interval.QwtInterval other: other interval
329+
:param .interval.QwtInterval other: other interval
330330
:return: True, when the intervals are intersecting
331331
"""
332332
if not other.isValid() or not self.isValid():

qwt/legend.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121

2222
import numpy as np
2323

24-
from qwt.qt.QtGui import (QFrame, QScrollArea, QWidget, QVBoxLayout, QPalette,
24+
from .qt.QtGui import (QFrame, QScrollArea, QWidget, QVBoxLayout, QPalette,
2525
QApplication, QStyleOption, QStyle, QPixmap,
2626
QPainter, qDrawWinButton)
27-
from qwt.qt.QtCore import Signal, QEvent, QSize, Qt, QRect, QRectF, QPoint
27+
from .qt.QtCore import Signal, QEvent, QSize, Qt, QRect, QRectF, QPoint
2828

29-
from qwt.text import QwtText, QwtTextLabel
30-
from qwt.dyngrid_layout import QwtDynGridLayout
31-
from qwt.painter import QwtPainter
29+
from .text import QwtText, QwtTextLabel
30+
from .dyngrid_layout import QwtDynGridLayout
31+
from .painter import QwtPainter
3232

3333

3434
class QwtLegendData(object):
@@ -45,7 +45,7 @@ class QwtLegendData(object):
4545
4646
.. seealso::
4747
48-
:py:class:`qwt.legend.QwtLegend`
48+
:py:class:`.legend.QwtLegend`
4949
5050
.. note::
5151
@@ -214,15 +214,15 @@ def data(self):
214214
215215
.. seealso::
216216
217-
:py:meth:`setData()`, :py:meth:`qwt.plot.QwtPlotItem.legendData()`
217+
:py:meth:`setData()`, :py:meth:`.plot.QwtPlotItem.legendData()`
218218
"""
219219
return self.__data.legendData
220220

221221
def setText(self, text):
222222
"""
223223
Set the text to the legend item
224224
225-
:param qwt.text.QwtText text: Text label
225+
:param .text.QwtText text: Text label
226226
227227
.. seealso::
228228
@@ -270,7 +270,7 @@ def setIcon(self, icon):
270270
271271
.. seealso::
272272
273-
:py:meth:`icon()`, :py:meth:`qwt.plot.QwtPlotItem.legendIcon()`
273+
:py:meth:`icon()`, :py:meth:`.plot.QwtPlotItem.legendIcon()`
274274
"""
275275
self.__data.icon = icon
276276
indent = self.margin()+self.__data.spacing
@@ -296,7 +296,7 @@ def setSpacing(self, spacing):
296296
297297
.. seealso::
298298
299-
:py:meth:`spacing()`, :py:meth:`qwt.text.QwtTextLabel.margin()`
299+
:py:meth:`spacing()`, :py:meth:`.text.QwtTextLabel.margin()`
300300
"""
301301
spacing = max([spacing, 0])
302302
if spacing != self.__data.spacing:
@@ -596,9 +596,9 @@ class QwtLegend(QwtAbstractLegend):
596596
597597
.. seealso ::
598598
599-
:py:class`qwt.legend.QwtLegendLabel`,
600-
:py:class`qwt.plot.QwtPlotItem`,
601-
:py:class`qwt.plot.QwtPlot`
599+
:py:class`.legend.QwtLegendLabel`,
600+
:py:class`.plot.QwtPlotItem`,
601+
:py:class`.plot.QwtPlot`
602602
603603
.. py:class:: QwtLegend([parent=None])
604604

qwt/math.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization
66
# (see LICENSE file for more details)
77

8-
from qwt.qt.QtCore import qFuzzyCompare
8+
from .qt.QtCore import qFuzzyCompare
99

1010
import numpy as np
1111

qwt/null_paintdevice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:members:
1414
"""
1515

16-
from qwt.qt.QtGui import QPaintEngine, QPainterPath, QPaintDevice
16+
from .qt.QtGui import QPaintEngine, QPainterPath, QPaintDevice
1717

1818

1919
class QwtNullPaintDevice_PrivateData(object):

qwt/painter.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
:members:
1414
"""
1515

16-
from qwt.color_map import QwtColorMap
17-
from qwt.scale_map import QwtScaleMap
16+
from .color_map import QwtColorMap
17+
from .scale_map import QwtScaleMap
1818

19-
from qwt.qt.QtGui import (QPaintEngine, QFrame, QPixmap, QPainter, QPalette,
19+
from .qt.QtGui import (QPaintEngine, QFrame, QPixmap, QPainter, QPalette,
2020
QStyle, QPen, QStyleOptionFocusRect, QBrush,
2121
QLinearGradient, QPainterPath, QColor, QStyleOption)
22-
from qwt.qt.QtCore import Qt, QRect, QPoint, QT_VERSION
22+
from .qt.QtCore import Qt, QRect, QPoint, QT_VERSION
2323

2424
QWIDGETSIZE_MAX = (1<<24)-1
2525

@@ -321,9 +321,9 @@ def drawColorBar(self, painter, colorMap, interval, scaleMap,
321321
Draw a color bar into a rectangle
322322
323323
:param QPainter painter: Painter
324-
:param qwt.color_map.QwtColorMap colorMap: Color map
325-
:param qwt.interval.QwtInterval interval: Value range
326-
:param qwt.scalemap.QwtScaleMap scaleMap: Scale map
324+
:param .color_map.QwtColorMap colorMap: Color map
325+
:param .interval.QwtInterval interval: Value range
326+
:param .scalemap.QwtScaleMap scaleMap: Scale map
327327
:param Qt.Orientation orientation: Orientation
328328
:param QRectF rect: Target rectangle
329329
"""
@@ -428,7 +428,7 @@ def backingStore(self, widget, size):
428428
if widget and widget.windowHandle():
429429
pixelRatio = widget.windowHandle().devicePixelRatio()
430430
else:
431-
from qwt.qt.QtGui import qApp
431+
from .qt.QtGui import qApp
432432
if qApp is not None:
433433
try:
434434
pixelRatio = qApp.devicePixelRatio()

0 commit comments

Comments
 (0)