mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 17:55:20 +00:00
parent
7d84409628
commit
1ec71cbaca
1 changed files with 3 additions and 2 deletions
|
@ -74,10 +74,11 @@ def _find_system_cameras():
|
||||||
devices = {} # Name -> device
|
devices = {} # Name -> device
|
||||||
if os.path.exists(device_root):
|
if os.path.exists(device_root):
|
||||||
for device in os.listdir(device_root):
|
for device in os.listdir(device_root):
|
||||||
|
path = os.path.join(device_root, device, 'name')
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(device_root, device, 'name'), encoding='utf-8') as f:
|
with open(path, encoding='utf-8') as f:
|
||||||
name = f.read()
|
name = f.read()
|
||||||
except IOError:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
name = name.strip('\n')
|
name = name.strip('\n')
|
||||||
devices[name] = os.path.join("/dev", device)
|
devices[name] = os.path.join("/dev", device)
|
||||||
|
|
Loading…
Add table
Reference in a new issue