Transliterate non-ASCII for display on the screen (#449)

This commit is contained in:
Daniel Markstedt 2021-11-13 17:44:09 -08:00 committed by GitHub
parent 61c4534eab
commit 70d58118fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@
Module for commands sent to the RaSCSI backend service. Module for commands sent to the RaSCSI backend service.
""" """
from os import path from os import path
from unidecode import unidecode
from socket_cmds import send_pb_command from socket_cmds import send_pb_command
import rascsi_interface_pb2 as proto import rascsi_interface_pb2 as proto
@ -34,7 +35,8 @@ def device_list():
if dstat.locked and dprop.lockable: if dstat.locked and dprop.lockable:
dstat_msg.append("Locked") dstat_msg.append("Locked")
dfile = path.basename(result.devices_info.devices[i].file.name) # Transliterate non-ASCII chars in the file name to ASCII
dfile = unidecode(path.basename(result.devices_info.devices[i].file.name))
dven = result.devices_info.devices[i].vendor dven = result.devices_info.devices[i].vendor
dprod = result.devices_info.devices[i].product dprod = result.devices_info.devices[i].product

View File

@ -13,3 +13,4 @@ rpi-ws281x==4.3.0
RPi.GPIO==0.7.0 RPi.GPIO==0.7.0
sysv-ipc==1.1.0 sysv-ipc==1.1.0
protobuf==3.17.3 protobuf==3.17.3
unidecode==1.3.2