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 @@ -74,22 +74,23 @@ def _info(self, *args):
74
74
attrs = {"window_id" : self ._window_id }
75
75
76
76
# from https://github.com/serkanyersen/underscore.py
77
- def by (val , * args ):
78
- for key , value in attrs .items ():
77
+ def by (val ):
78
+ for key in attrs .keys ():
79
79
try :
80
80
if attrs [key ] != val [key ]:
81
81
return False
82
82
except KeyError :
83
83
return False
84
- return True
84
+ return True
85
85
86
- ret = list (filter (by , self .server ._windows ))
86
+ # TODO add type hint
87
+ target_windows = list (filter (by , self .server ._windows ))
87
88
# If a window_shell option was configured which results in
88
89
# a short-lived process, the window id is @0. Use that instead of
89
90
# self._window_id
90
- if len (ret ) == 0 and self .server ._windows [0 ]["window_id" ] == "@0" :
91
- ret = self .server ._windows
92
- return ret [0 ]
91
+ if len (target_windows ) == 0 and self .server ._windows [0 ]["window_id" ] == "@0" :
92
+ target_windows = self .server ._windows
93
+ return target_windows [0 ]
93
94
94
95
def cmd (self , cmd , * args , ** kwargs ):
95
96
"""Return :meth:`Server.cmd` defaulting ``target_window`` as target.
You can’t perform that action at this time.
0 commit comments