Skip to content

Commit

Permalink
Corrected inconsistent property, getter and setter use. Fixed #16.
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Jan 16, 2024
1 parent 7a1bcc1 commit f0e9fa6
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions LXMF/LXMessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ def set_fields(self, fields):
def get_fields(self):
return self.fields

@property
def destination(self):
return self.__destination

@destination.setter
def destination(self, destination):
self.set_destination(destination)

def get_destination(self):
return self.destination

def set_destination(self, destination):
if self.destination == None:
if isinstance(destination, RNS.Destination):
Expand All @@ -179,8 +190,16 @@ def set_destination(self, destination):
else:
raise ValueError("Cannot reassign destination on LXMessage")

def get_destination(self):
return self.__destination
@property
def source(self):
return self.__source

@source.setter
def source(self, source):
self.set_source(source)

def get_source(self):
return self.source

def set_source(self, source):
if self.source == None:
Expand All @@ -191,9 +210,6 @@ def set_source(self, source):
else:
raise ValueError("Cannot reassign source on LXMessage")

def get_source(self):
return self.__source

def set_delivery_destination(self, delivery_destination):
self.__delivery_destination = delivery_destination

Expand Down

0 comments on commit f0e9fa6

Please sign in to comment.