Skip to content

Commit f0e9fa6

Browse files
committed
Corrected inconsistent property, getter and setter use. Fixed markqvist#16.
1 parent 7a1bcc1 commit f0e9fa6

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

LXMF/LXMessage.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,17 @@ def set_fields(self, fields):
170170
def get_fields(self):
171171
return self.fields
172172

173+
@property
174+
def destination(self):
175+
return self.__destination
176+
177+
@destination.setter
178+
def destination(self, destination):
179+
self.set_destination(destination)
180+
181+
def get_destination(self):
182+
return self.destination
183+
173184
def set_destination(self, destination):
174185
if self.destination == None:
175186
if isinstance(destination, RNS.Destination):
@@ -179,8 +190,16 @@ def set_destination(self, destination):
179190
else:
180191
raise ValueError("Cannot reassign destination on LXMessage")
181192

182-
def get_destination(self):
183-
return self.__destination
193+
@property
194+
def source(self):
195+
return self.__source
196+
197+
@source.setter
198+
def source(self, source):
199+
self.set_source(source)
200+
201+
def get_source(self):
202+
return self.source
184203

185204
def set_source(self, source):
186205
if self.source == None:
@@ -191,9 +210,6 @@ def set_source(self, source):
191210
else:
192211
raise ValueError("Cannot reassign source on LXMessage")
193212

194-
def get_source(self):
195-
return self.__source
196-
197213
def set_delivery_destination(self, delivery_destination):
198214
self.__delivery_destination = delivery_destination
199215

0 commit comments

Comments
 (0)