mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-05-30 19:37:43 +02:00
Added __getstate__ and __setstate__ to IrcState
This commit is contained in:
parent
d37e229027
commit
896ce38514
@ -163,6 +163,15 @@ class IrcState(object):
|
|||||||
self.nicksToHostmasks = {}
|
self.nicksToHostmasks = {}
|
||||||
self.channels = {}
|
self.channels = {}
|
||||||
|
|
||||||
|
def __getstate__(self):
|
||||||
|
d = {}
|
||||||
|
for s in self.__slots__:
|
||||||
|
d[s] = getattr(self, s)
|
||||||
|
|
||||||
|
def __setstate__(self, d):
|
||||||
|
for (name, value) in d.iteritems():
|
||||||
|
setattr(self, name, value)
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
ret = self.__class__()
|
ret = self.__class__()
|
||||||
ret.history = copy.copy(self.history)
|
ret.history = copy.copy(self.history)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user