File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -68,22 +68,23 @@ def _info(self, *args):
68
68
attrs = {"window_id" : self ._window_id }
69
69
70
70
# from https://github.com/serkanyersen/underscore.py
71
- def by (val , * args ):
72
- for key , value in attrs .items ():
71
+ def by (val ):
72
+ for key in attrs .keys ():
73
73
try :
74
74
if attrs [key ] != val [key ]:
75
75
return False
76
76
except KeyError :
77
77
return False
78
- return True
78
+ return True
79
79
80
- ret = list (filter (by , self .server ._windows ))
80
+ # TODO add type hint
81
+ target_windows = list (filter (by , self .server ._windows ))
81
82
# If a window_shell option was configured which results in
82
83
# a short-lived process, the window id is @0. Use that instead of
83
84
# self._window_id
84
- if len (ret ) == 0 and self .server ._windows [0 ]["window_id" ] == "@0" :
85
- ret = self .server ._windows
86
- return ret [0 ]
85
+ if len (target_windows ) == 0 and self .server ._windows [0 ]["window_id" ] == "@0" :
86
+ target_windows = self .server ._windows
87
+ return target_windows [0 ]
87
88
88
89
def cmd (self , cmd , * args , ** kwargs ):
89
90
"""Return :meth:`Server.cmd` defaulting ``target_window`` as target.
You can’t perform that action at this time.
0 commit comments