Skip to content

Commit

Permalink
Fix Redirect GUI
Browse files Browse the repository at this point in the history
(cherry picked from commit 280a1589a401d1d4a5a39190d2d0199159cd5a7d)
  • Loading branch information
Buthaina Mahmoud authored and DiegoTavares committed Sep 18, 2020
1 parent 953273c commit 0d87a15
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cuegui/cuegui/Redirect.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, selected="pipe", parent=None):
def refresh(self):
self.clear()
shows = opencue.api.getActiveShows()
shows.sort(key=lambda x, y: cmp(x.data.name, y.data.name))
shows.sort(key=lambda x: x.data.name)

for show in shows:
self.addItem(show.data.name, show)
Expand Down Expand Up @@ -92,7 +92,7 @@ def refresh(self):
Refresh the full list of allocations.
"""
allocs = opencue.api.getAllocations()
allocs.sort(key=lambda x, y: cmp(x.data.name, y.data.name))
allocs.sort(key=lambda x: x.data.name)

self.__menu.clear()
checked = 0
Expand Down Expand Up @@ -297,7 +297,8 @@ def _cfg(self):
self.__config = cuegui.Utils.getResourceConfig()
return self.__config

def showChanged(self, show):
def showChanged(self, show_index):
show = self.__show_combo.currentText()
self.__current_show = opencue.api.findShow(str(show))
self.__include_group_btn.showChanged(self.__current_show)

Expand All @@ -311,11 +312,11 @@ def detect(self, name=None):
minCores = 1.0
minMem = 0
for layer in layers:
if layer.data.minCores > minCores:
minCores = layer.data.minCores
if layer.data.min_cores > minCores:
minCores = layer.data.min_cores

if layer.data.minMemory > minMem:
minMem = layer.data.minMemory
if layer.data.min_memory > minMem:
minMem = layer.data.min_memory

self.__cores_spin.setValue(int(minCores))
self.__mem_spin.setValue(float(minMem / 1048576.0))
Expand Down

0 comments on commit 0d87a15

Please sign in to comment.