Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Mar 7, 2023
1 parent 9aaac40 commit c4ba363
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
22 changes: 0 additions & 22 deletions .archive/coro.py

This file was deleted.

14 changes: 5 additions & 9 deletions .archive/findssh.m
Expand Up @@ -7,15 +7,11 @@
% example (find all SSH servers on IPv4 subnet on Port 22):
% findssh()

assert(~verLessThan('matlab', '8.4'), 'Matlab >= R2014b required')

if nargin < 1, port=22; end
if nargin < 2, service = ''; end
if nargin < 3, timeout = 0.1; end

validateattributes(port, {'numeric'}, {'integer', 'nonnegative'})
validateattributes(service, {'string', 'char'}, {'scalartext'})
validateattributes(timeout, {'numeric'}, {'real', 'nonnegative'})
arguments
port (1,1) {mustBeInteger, mustBePositive} = 22
service (1,1) string = ""
timeout (1,1) {mustBeReal, mustBePositive} = 0.1
end

net = py.findssh.address2net(py.findssh.get_lan_ip());

Expand Down
5 changes: 2 additions & 3 deletions src/findssh/coro.py
Expand Up @@ -25,9 +25,8 @@ async def get_hosts(
"""

hosts = []
for h in asyncio.as_completed(
[waiter(host, port, service, timeout) for host in net.hosts()]
):
futures = [waiter(host, port, service, timeout) for host in net.hosts()]
for h in asyncio.as_completed(futures):
if host := await h:
print(host)
hosts.append(host)
Expand Down

0 comments on commit c4ba363

Please sign in to comment.