-
-
Save metacoma/765e3845e823c235f83ebe7532ea58af to your computer and use it in GitHub Desktop.
modelina python serialize/desialize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TmuxPaneIoDocument: | |
def __init__(self, input): | |
self._input = input.input | |
self._output = input.output | |
self._ps1 = input.ps1 | |
@property | |
def input(self): | |
return self._input | |
@input.setter | |
def input(self, input): | |
self._input = input | |
@property | |
def output(self): | |
return self._output | |
@output.setter | |
def output(self, output): | |
self._output = output | |
@property | |
def ps1(self): | |
return self._ps1 | |
@ps1.setter | |
def ps1(self, ps1): | |
self._ps1 = ps1 | |
def serializeToJson(self): | |
return json.dumps(self.__dict__, default=lambda o: o.__dict__, indent=2) | |
@staticmethod | |
def deserializeFromJson(json_string): | |
return TmuxPaneIoDocument(**json.loads(json_string)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment