openwebrx-clone/owrx/form/input/receiverid.py
2021-04-29 15:17:21 +02:00

11 lines
335 B
Python

from owrx.form.input.converter import Converter
class ReceiverKeysConverter(Converter):
def convert_to_form(self, value):
return "" if value is None else "\n".join(value)
def convert_from_form(self, value):
# \r\n or \n? this should work with both.
return [v.strip("\r ") for v in value.split("\n")]