Skip to content

Commit bd0f8ef

Browse files
author
Tony Crisci
committed
examples: fix workspace_renumber.py
fixes #138
1 parent 30f9d03 commit bd0f8ef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/workspace_renumber.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# check if workspaces are all in order
1010
def workspaces_ordered(i3conn):
1111
last_workspace = 0
12-
for i in sorted(i3conn.get_workspaces(), key=lambda x: x['num']):
13-
number = int(i['num'])
12+
for i in sorted(i3conn.get_workspaces(), key=lambda x: x.num):
13+
number = int(i.num)
1414
if number != last_workspace + 1:
1515
return False
1616
last_workspace += 1
@@ -22,11 +22,11 @@ def workspaces_ordered(i3conn):
2222
def find_disordered(i3conn):
2323
disordered = []
2424
least_number = None
25-
workspaces = sorted(i3conn.get_workspaces(), key=lambda x: x['num'])
26-
occupied_workspaces = [int(x['num']) for x in workspaces]
25+
workspaces = sorted(i3conn.get_workspaces(), key=lambda x: x.num)
26+
occupied_workspaces = [int(x.num) for x in workspaces]
2727
last_workspace = 0
2828
for i in workspaces:
29-
number = int(i['num'])
29+
number = int(i.num)
3030
if number != last_workspace + 1:
3131
disordered.append(number)
3232
if least_number is None and last_workspace + 1 not in occupied_workspaces:

0 commit comments

Comments
 (0)