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 May 26, 2024
1 parent 7f36eb4 commit bd5c621
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions qubesadmin/device_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def qbool(value):


class Device:
ALLOWED_CHARS_KEY = string.digits + string.ascii_letters + '-_.'
ALLOWED_CHARS_PARAM = ALLOWED_CHARS_KEY + ',+:'
ALLOWED_CHARS_KEY = string.digits + string.ascii_letters + string.punctuation + ' '
ALLOWED_CHARS_PARAM = ALLOWED_CHARS_KEY + string.punctuation + ' '

def __init__(self, backend_domain, ident, devclass=None):
self.__backend_domain = backend_domain
Expand Down Expand Up @@ -380,7 +380,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 @@ -677,7 +678,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

0 comments on commit bd5c621

Please sign in to comment.