Skip to content

Commit

Permalink
q-dev: broder allowance of names
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Jun 12, 2024
1 parent da079f2 commit b89a89c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions qubes/device_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ def _load_classes(bus: str):

class DeviceInfo(Device):
""" Holds all information about a device """
ALLOWED_CHARS_PARAM = Device.ALLOWED_CHARS_PARAM + string.punctuation + ' '
ALLOWED_CHARS_KEY = Device.ALLOWED_CHARS_KEY + string.punctuation + ' '
ALLOWED_CHARS_PARAM = Device.ALLOWED_CHARS_PARAM + string.punctuation + ' '

def __init__(
self,
Expand Down Expand Up @@ -655,7 +656,10 @@ def self_identity(self) -> str:


def serialize_str(value: str):
return repr(str(value))
result = repr(str(value))
if result.startswith('"'):
result = "'" + result[1:-1] + "'"
return result


def deserialize_str(value: str):
Expand Down
4 changes: 2 additions & 2 deletions qubes/ext/pci.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,11 @@ def _load_desc(self) -> Dict[str, str]:
self._vendor = result["vendor"] = hostdev_xml.findtext(
'capability/vendor')
self._vendor_id = result["vendor ID"] = hostdev_xml.xpath(
"//vendor/@id")
"//vendor/@id")[0]
self._product = result["product"] = hostdev_xml.findtext(
'capability/product')
self._product_id = result["product ID"] = hostdev_xml.xpath(
"//product/@id")
"//product/@id")[0]
return result

@staticmethod
Expand Down

0 comments on commit b89a89c

Please sign in to comment.