Skip to content

Commit

Permalink
Fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoTavares committed May 13, 2024
1 parent a3ee8a2 commit 570e987
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
8 changes: 5 additions & 3 deletions cuegui/cuegui/Comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,10 @@ def refreshComments(self):
def __macroLoad(self):
"""Loads the defined comment macros from settings"""
comments_macro = self.app.settings.value("Comments", pickle.dumps({}))
try:
self.__macroList = pickle.loads(
comments_macro if isinstance(comments_macro, bytes) else comments_macro.encode('UTF-8'))
try:
self.__macroList = pickle.loads(
comments_macro if isinstance(comments_macro, bytes) \
else comments_macro.encode('UTF-8'))
except TypeError:
self.__macroList = pickle.loads(str(comments_macro))
self.__macroRefresh()
Expand Down Expand Up @@ -349,6 +350,7 @@ def __addComment(self, subject, message):
source.addComment(str(subject), str(message) or " ")

def getComments(self):
"""Get Comments"""
comments = {}
for source in self.__source:
comments[source.data.name] = source.getComments()
Expand Down
2 changes: 1 addition & 1 deletion cuegui/cuegui/ServiceDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
from qtpy import QtWidgets

import opencue
from opencue.wrappers.service import ServiceOverride

import cuegui.Constants
import cuegui.TagsWidget
import cuegui.Utils
from opencue.wrappers.service import ServiceOverride


class ServiceForm(QtWidgets.QWidget):
Expand Down
2 changes: 2 additions & 0 deletions cuesubmit/cuesubmit/ui/Widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@ def setupUi(self):
def setupConnections(self):
"""Sets up widget signals."""
self.valueChanged.connect(self.updateLabelValue)
# pylint: disable=no-member
self.slider.valueChanged.connect(self.valueChanged.emit)
self.slider.sliderMoved.connect(self.sliderMoved.emit)
self.slider.sliderReleased.connect(self.sliderReleased.emit)
self.slider.actionTriggered.connect(self.actionTriggered.emit)
self.slider.rangeChanged.connect(self.rangeChanged.emit)
# pylint: enable=no-member

def updateLabelValue(self, value):
""" Updates the label with the slider's value at the end
Expand Down
14 changes: 8 additions & 6 deletions pycue/opencue/wrappers/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,22 +261,24 @@ def setMinMemoryIncrease(self, min_memory_increase):
raise ValueError("Minimum memory increase must be > 0")

class ServiceOverride(object):
"""Represents a display override of a service assigned to a show"""
def __init__(self, serviceOverride=None):
defaultServiceOverride = service_pb2.ServiceOverride()
# pylint: disable=no-member
self.id = defaultServiceOverride.id
self.data = defaultServiceOverride.data
if serviceOverride:
self.id = serviceOverride.id
self.data = serviceOverride.data or service_pb2.Service().data
else:
defaultServiceOverride = service_pb2.ServiceOverride()
self.id = defaultServiceOverride.id
self.data = defaultServiceOverride.data

self.stub = Cuebot.getStub("serviceOverride")
# pylint: enable=no-member

def delete(self):
"""Remove service override"""
self.stub.Delete(
service_pb2.ServiceOverrideDeleteRequest(service=self.data),
timeout=Cuebot.Timeout)

def update(self):
"""Commit a ServiceOverride change to the database"""
self.stub.Update(
Expand Down
1 change: 0 additions & 1 deletion pycue/opencue/wrappers/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def createServiceOverride(self, data):
# min_memory_increase has to be greater than 0.
if data.min_memory_increase <= 0:
raise ValueError("Minimum memory increase must be > 0")

self.stub.CreateServiceOverride(show_pb2.ShowCreateServiceOverrideRequest(
show=self.data, service=data),
timeout=Cuebot.Timeout)
Expand Down

0 comments on commit 570e987

Please sign in to comment.