From 63f83224f474c2c191e8cac3cb6bda8f2cb81b7d Mon Sep 17 00:00:00 2001 From: Denis Jacquerye Date: Mon, 19 Oct 2015 10:24:34 +0100 Subject: Use PEP8 code style --- Lib/defconQt/layerSetList.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'Lib/defconQt/layerSetList.py') diff --git a/Lib/defconQt/layerSetList.py b/Lib/defconQt/layerSetList.py index 485477b..e5617b9 100644 --- a/Lib/defconQt/layerSetList.py +++ b/Lib/defconQt/layerSetList.py @@ -1,11 +1,14 @@ from PyQt5.QtCore import Qt from PyQt5.QtGui import QKeySequence, QColor, QPixmap, QIcon -from PyQt5.QtWidgets import (QApplication, QWidget, QMenu, QListWidget, - QListWidgetItem, QAbstractItemView, QVBoxLayout, QAction, QColorDialog) -from defconQt import icons_db +from PyQt5.QtWidgets import ( + QApplication, QListWidget, QListWidgetItem, QAbstractItemView, QAction, + QColorDialog) +# from defconQt import icons_db from defconQt.glyphView import AddLayerDialog + class LayerSetList(QListWidget): + def __init__(self, parent=None, *args, **kwargs): super().__init__(parent, *args, **kwargs) @@ -27,7 +30,7 @@ class LayerSetList(QListWidget): action = QAction("Change &Name", self) action.setShortcuts(QKeySequence('n')) - action.triggered.connect(lambda : self.editItem(self.currentItem())) + action.triggered.connect(lambda: self.editItem(self.currentItem())) self.addAction(action) action = QAction("Change &Color", self) @@ -81,7 +84,7 @@ class LayerSetList(QListWidget): item.setFlags(item.flags() | Qt.ItemIsEditable) - return item; + return item def _getCurrentLayer(self): item = self.currentItem() @@ -99,7 +102,7 @@ class LayerSetList(QListWidget): # because I think we can't handle a font without a default layer # TODO: try this return - del self._layerSet[layer.name]; + del self._layerSet[layer.name] def _reordered(self, *args): # get a new layer order @@ -122,8 +125,10 @@ class LayerSetList(QListWidget): if not layer: return - startColor = layer.color and QColor.fromRgbF(*layer.color) or QColor('limegreen') - qcolor = QColorDialog.getColor(startColor, self, options=QColorDialog.ShowAlphaChannel) + startColor = layer.color and QColor.fromRgbF(*layer.color) or \ + QColor('limegreen') + qcolor = QColorDialog.getColor( + startColor, self, options=QColorDialog.ShowAlphaChannel) if not qcolor.isValid(): # cancelled return -- cgit v1.2.3