Skip to content

Commit

Permalink
fix usage in devices.py; implement --recycle
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Sep 30, 2023
1 parent 5befb1d commit e6acbee
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions unit-tests/py/rspy/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
# Copyright(c) 2021 Intel Corporation. All Rights Reserved.

import sys, os, re, platform

def usage():
ourname = os.path.basename( sys.argv[0] )
print( 'Syntax: devices [actions|flags]' )
print( ' Control the LibRS devices connected' )
print( 'Actions (only one)' )
print( ' --list Enumerate devices (default action)' )
print( ' --recycle Recycle all' )
print( 'Flags:' )
print( ' --all Enable all port [requires acroname]' )
print( ' --port <#> Enable only this port [requires acroname]' )
print( ' --ports Show physical port for each device (rather than the RS string)' )
sys.exit(2)

try:
from rspy import log
except ModuleNotFoundError:
if __name__ != '__main__':
raise
#
def usage():
ourname = os.path.basename( sys.argv[0] )
print( 'Syntax: devices [actions|flags]' )
print( ' Control the LibRS devices connected' )
print( 'Actions (only one)' )
print( ' --list Enumerate devices (default action)' )
print( ' --recycle Recycle all' )
print( 'Flags:' )
print( ' --all Enable all port [requires acroname]' )
print( ' --port <#> Enable only this port [requires acroname]' )
print( ' --ports Show physical port for each device (rather than the RS string)' )
sys.exit(2)
#
# We need to tell Python where to look for rspy
rspy_dir = os.path.dirname( os.path.abspath( __file__ ))
py_dir = os.path.dirname( rspy_dir )
Expand Down Expand Up @@ -787,7 +788,7 @@ def get_phys_port(dev):
handle = printer(device)
))
elif action == 'recycle':
log.f( 'Not implemented yet' )
acroname.recycle_ports()
finally:
#
# Disconnect from the Acroname -- if we don't it'll crash on Linux...
Expand Down

0 comments on commit e6acbee

Please sign in to comment.