GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (4082)

Orange/widgets/io.py (11 issues)

1
from Orange.data.io import FileFormats
2
from PyQt4 import QtGui, QtCore, QtSvg
0 ignored issues
show
The import PyQt4 could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
3
4
from pyqtgraph.graphicsItems.GraphicsWidget import GraphicsWidget
0 ignored issues
show
The import pyqtgraph.graphicsItems.GraphicsWidget could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
5
from pyqtgraph.exporters.SVGExporter import SVGExporter
0 ignored issues
show
The import pyqtgraph.exporters.SVGExporter could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
6
from pyqtgraph.exporters.ImageExporter import ImageExporter
0 ignored issues
show
The import pyqtgraph.exporters.ImageExporter could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
7
8
9
class ImgFormat:
10
    @staticmethod
11
    def _get_buffer(size, filename):
12
        raise NotImplementedError(
13
            "Descendants of ImgFormat must override method _get_buffer")
14
15
    @staticmethod
16
    def _get_target(self, scene, painter, buffer):
0 ignored issues
show
Static method with 'self' as first argument
Loading history...
17
        raise NotImplementedError(
18
            "Descendants of ImgFormat must override method _get_target")
19
20
    @staticmethod
21
    def _save_buffer(self, buffer, filename):
0 ignored issues
show
Static method with 'self' as first argument
Loading history...
22
        raise NotImplementedError(
23
            "Descendants of ImgFormat must override method _save_buffer")
24
25
    @staticmethod
26
    def _get_exporter(self):
0 ignored issues
show
Static method with 'self' as first argument
Loading history...
27
        raise NotImplementedError(
28
            "Descendants of ImgFormat must override method _get_exporter")
29
30
    @classmethod
31
    def write_image(cls, filename, scene):
32
        if isinstance(scene, GraphicsWidget):
33
            exporter = cls._get_exporter()
34
            exp = exporter(scene)
35
            exp.export(filename)
36
        else:
37
            source = scene.itemsBoundingRect().adjusted(-15, -15, 15, 15)
38
            buffer = cls._get_buffer(source.size(), filename)
39
40
            painter = QtGui.QPainter()
41
            painter.begin(buffer)
42
            painter.setRenderHint(QtGui.QPainter.Antialiasing)
43
44
            target = cls._get_target(scene, painter, buffer, source)
45
            scene.render(painter, target, source)
46
            cls._save_buffer(buffer, filename)
47
            painter.end()
48
49
    def write(self, filename, scene):
50
        if type(scene) == dict:
51
            scene = scene['scene']
52
        self.write_image(filename, scene)
53
54
55
@FileFormats.register("Portable Network Graphics", ".png")
56
class PngFormat(ImgFormat):
57
    @staticmethod
58
    def _get_buffer(size, filename):
59
        return QtGui.QPixmap(int(size.width()), int(size.height()))
60
61
    @staticmethod
62
    def _get_target(scene, painter, buffer, source):
63
        brush = scene.backgroundBrush()
64
        if brush.style() == QtCore.Qt.NoBrush:
65
            brush = QtGui.QBrush(scene.palette().color(QtGui.QPalette.Base))
66
        painter.fillRect(buffer.rect(), brush)
67
        return QtCore.QRectF(0, 0, source.width(), source.height())
68
69
    @staticmethod
70
    def _save_buffer(buffer, filename):
0 ignored issues
show
Arguments number differs from overridden '_save_buffer' method
Loading history...
71
        buffer.save(filename)
72
73
    @staticmethod
74
    def _get_exporter():
0 ignored issues
show
Arguments number differs from overridden '_get_exporter' method
Loading history...
75
        return ImageExporter
76
77
78
@FileFormats.register("Scalable Vector Graphics", ".svg")
79
class SvgFormat(ImgFormat):
80
    @staticmethod
81
    def _get_buffer(size, filename):
82
        buffer = QtSvg.QSvgGenerator()
83
        buffer.setFileName(filename)
84
        buffer.setSize(QtCore.QSize(int(size.width()), int(size.height())))
85
        return buffer
86
87
    @staticmethod
88
    def _get_target(scene, painter, buffer, source):
89
        return QtCore.QRectF(0, 0, source.width(), source.height())
90
91
    @staticmethod
92
    def _save_buffer(buffer, filename):
0 ignored issues
show
Arguments number differs from overridden '_save_buffer' method
Loading history...
93
        pass
94
95
    @staticmethod
96
    def _get_exporter():
0 ignored issues
show
Arguments number differs from overridden '_get_exporter' method
Loading history...
97
        return SVGExporter
98