mirror of
https://github.com/wassname/sloth.git
synced 2026-06-27 18:44:36 +08:00
PEP8 changes
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
"""This is the AnnotationScene module"""
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import *
|
||||
from sloth.items import *
|
||||
from sloth.core.exceptions import InvalidArgumentException
|
||||
from sloth.annotations.model import AnnotationModelItem
|
||||
@@ -9,19 +7,20 @@ from sloth.conf import config
|
||||
import logging
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AnnotationScene(QGraphicsScene):
|
||||
mousePositionChanged = pyqtSignal(float, float)
|
||||
def __init__(self, labeltool, items=None, inserters=None, parent=None):
|
||||
super(AnnotationScene, self).__init__(parent)
|
||||
|
||||
self._model = None
|
||||
self._model = None
|
||||
self._image_item = None
|
||||
self._inserter = None
|
||||
self._inserter = None
|
||||
self._scene_item = None
|
||||
self._message = ""
|
||||
self._labeltool = labeltool
|
||||
self._message = ""
|
||||
self._labeltool = labeltool
|
||||
|
||||
self._itemfactory = Factory(items)
|
||||
self._itemfactory = Factory(items)
|
||||
self._inserterfactory = Factory(inserters)
|
||||
|
||||
try:
|
||||
@@ -268,7 +267,7 @@ class AnnotationScene(QGraphicsScene):
|
||||
found = False
|
||||
|
||||
items = [item for item in self.items()
|
||||
if item.flags() & QGraphicsItem.ItemIsSelectable] * 2
|
||||
if item.flags() & QGraphicsItem.ItemIsSelectable] * 2
|
||||
if reverse:
|
||||
items.reverse()
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ def unique_list(seq):
|
||||
seen = {}
|
||||
result = []
|
||||
for item in seq:
|
||||
if item in seen: continue
|
||||
if item in seen:
|
||||
continue
|
||||
seen[item] = 1
|
||||
result.append(item)
|
||||
return result
|
||||
@@ -186,7 +187,7 @@ class ButtonArea(QWidget):
|
||||
def clickedLabelButton(self, label_name):
|
||||
#button = self.get_checked_label_button()
|
||||
#print button
|
||||
if label_name != None:
|
||||
if label_name is not None:
|
||||
LOG.debug("ButtonArea: %s" % label_name)
|
||||
self.show_only_label_properties(label_name)
|
||||
else:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys, os
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import *
|
||||
|
||||
|
||||
class Label(QLabel):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -12,6 +12,7 @@ class Label(QLabel):
|
||||
menu.addActions(self.actions())
|
||||
menu.exec_(ev.globalPos())
|
||||
|
||||
|
||||
class ControlButtonWidget(QWidget):
|
||||
def __init__(self, parent=None):
|
||||
QWidget.__init__(self, parent)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from PyQt4.QtCore import Qt, QRect, QSize, QPoint
|
||||
from PyQt4.QtGui import QLayout, QSizePolicy, QWidgetItem
|
||||
|
||||
|
||||
class FloatingLayout(QLayout):
|
||||
def __init__(self, parent=None):
|
||||
QLayout.__init__(self, parent)
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
from PyQt4.QtCore import QSize
|
||||
from PyQt4.QtGui import QVBoxLayout
|
||||
from PyQt4.QtGui import QVBoxLayout
|
||||
|
||||
|
||||
# This is really really ugly, but the QDockWidget for some reason does not notice when
|
||||
# its child widget becomes smaller...
|
||||
|
||||
Reference in New Issue
Block a user