openwebrx-clone/owrx/form/receiverid.py

11 lines
329 B
Python
Raw Normal View History

2021-02-08 20:30:12 +01:00
from owrx.form.converter import Converter
class ReceiverKeysConverter(Converter):
def convert_to_form(self, value):
2021-02-18 15:27:05 +01:00
return "" if value is None else "\n".join(value)
2021-02-08 20:30:12 +01:00
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")]